Skip to main content

Enhanced version of parsel, extracting data from HTML and XML using complex rules.

Features

  • Magic g method: extract items by complex rules

  • Apply filters to a value

  • x instance: many helper methods and filters

Plus all the standard features of parsel

>>> from parselx import SelectorX
>>> sel = SelectorX("""<html>
        <body>
            <h1>Hello, Parselx!</h1>
            <ul>
                <li><a href="http://example.com">Link 1</a></li>
                <li><a href="http://scrapy.org">Link 2</a></li>
            </ul>
        </body>
        </html>""")
>>>
>>> sel.g('h1')
'Hello, Parselx!'
>>> sel.g('h1 | reverse')
'!xlesraP ,olleH'
>>> sel.g('[ul li a]')
['Link 1', 'Link 2']
>>> sel.g({'title':['h1', lambda s: s.upper()], 'links':'[a @href]'})
{'title': 'HELLO, PARSELX!', 'links': ['http://example.com', 'http://scrapy.org']}
>>> sel.g('[ul li a @href| map:slice,7,-4]')
['example', 'scrapy']

Installation

$ pip install parselx

Metadata

Release files for parselx 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parselx 0.0.4
File Size Uploaded Provenance
parselx-0.0.4.tar.gz 5.1 kB Without provenance Details

Release files / parselx-0.0.4.tar.gz

Download URL parselx-0.0.4.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5082b8e8b95150bf0b6d00784e3c4fc6525c4df8f46dc5caddf684ea0dc37b70
BLAKE2b-256 checksum
How to use checksums
bd0a6dd4870d8677361800cfba67dddc07f1a57c78ae7d1cb4d3f5f29f720ed2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.4

Security for parselx 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page