scrapy/parsel
scrapy/parsel has 1,367 GitHub stars and 183 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-07 07:23 UTC. Last push 2026-11-01.
Parsel lets you extract data from XML/HTML documents using XPath or CSS selectors
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original====== Parsel
.. image:: https://github.com/scrapy/parsel/actions/workflows/tests-ubuntu.yml/badge.svg :target: https://github.com/scrapy/parsel/actions/workflows/tests-ubuntu.yml :alt: Tests
.. image:: https://img.shields.io/pypi/pyversions/parsel.svg :target: https://pypi.python.org/pypi/parsel :alt: Supported Python versions
.. image:: https://img.shields.io/pypi/v/parsel.svg :target: https://pypi.python.org/pypi/parsel :alt: PyPI Version
.. image:: https://img.shields.io/codecov/c/github/scrapy/parsel/master.svg :target: https://codecov.io/github/scrapy/parsel?branch=master :alt: Coverage report
Parsel is a BSD-licensed Python_ library to extract data from HTML_, JSON_, and XML_ documents.
It supports:
CSS_ and XPath_ expressions for HTML and XML documents
JMESPath_ and JSONPath_ expressions for JSON documents
Regular expressions_
Find the Parsel online documentation at https://parsel.readthedocs.org.
Example (open online demo_):
.. code-block:: pycon
>>> from parsel import Selector
>>> text = """
... <html>
... <body>
... <h1>Hello, Parsel!</h1>
... <ul>
... <li><a href="http://example.com">Link 1</a></li>
... <li><a href="http://scrapy.org">Link 2</a></li>
... </ul>
... <script type="application/json">{"a": ["b", "c"]}</script>
... </body>
... </html>"""
>>> selector = Selector(text=text)
>>> selector.css("h1::text").get()
'Hello, Parsel!'
>>> selector.xpath("//h1/text()").re(r"\w+")
['Hello', 'Parsel']
>>> for li in selector.css("ul > li"):
... print(li.xpath(".//@href").get())
...
http://example.com
http://scrapy.org
>>> selector.css("script::text").jmespath("a").get()
'b'
>>> selector.css("script::text").jmespath("a").getall()
['b', 'c']
.. _CSS: https://en.wikipedia.org/wiki/Cascading_Style_Sheets .. _HTML: https://en.wikipedia.org/wiki/HTML .. _JMESPath: https://jmespath.org/ .. _JSON: https://en.wikipedia.org/wiki/JSON .. _JSONPath: https://datatracker.ietf.org/doc/html/rfc9535 .. _open online demo: https://colab.research.google.com/drive/149VFa6Px3wg7S3SEnUqk--TyBrKplxCN#forceEdit=true&sandboxMode=true .. _Python: https://www.python.org/ .. _regular expressions: https://docs.python.org/library/re.html .. _XML: https://en.wikipedia.org/wiki/XML .. _XPath: https://en.wikipedia.org/wiki/XPath
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,703 starspublic-apis/public-apis
A collective list of free APIs
496,945 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
440,231 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,118 stars