PureHTML
PureHTML is a parsing specification for extracting JSON from HTML.
Installation:
To install PureHTML, you can use pip with following command:
pip install purehtml-purescraps
Usage
from purehtml import ConfigFactory, extract
yaml_string = """
selector: span
type: array
items: {}
"""
html_string = """
<div>
<span>a</span>
<span>b</span>
<span>c</span>
</div>
"""
expected_output = "['a', 'b', 'c']"
config = ConfigFactory.from_yaml(yaml_string)
print(f"Extracted output : {extract(config, html_string, 'http://example.com')}")
print(f"Expected output : {expected_output}")
Fallback Selectors & Transformer Quoting
PureHTML schemas allow resilient scraping with fallback selectors and parameter quoting:
# Fallback selectors for A/B tested DOM structures
selector:
- .flash-deal
- .sale-price
- .regular-price
# Quoted transformer arguments containing spaces, commas, or regex escapes
transform:
- 'replace("\\s+", " ")'
- 'split(", ")'
- 'join(" - ")'
Development
For testing, we use test specifications defined in <purehtml root>/specs.
You may run python3 run_tests.py to check if the python implementation
is working correctly or has some incompatibilities.
Building
- Install
buildpip with this command:python3 -m pip install --upgrade build - Execute
make clean buildto create a clean build output. The output will be placed indist/
Publishing to Python Package Index
- Install the
twinepackage:python3 -m pip install --upgrade twine - Publish to pypi:
python3 -m twine upload dist/*or withmake publish
License
Metadata
Release files for purehtml-purescraps 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| purehtml_purescraps-0.1.5.tar.gz | 20.2 kB | With provenance | Details for purehtml_purescraps-0.1.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| purehtml_purescraps-0.1.5-py3-none-any.whl | Python 3 | none | any | Details for purehtml_purescraps-0.1.5-py3-none-any.whl |
Total release size: 55.3 kB
Release files / purehtml_purescraps-0.1.5.tar.gz
| Download URL | purehtml_purescraps-0.1.5.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d00fb28093d053d2fb6ea9968666ec4bfcfe06de2465a3b0a4ecb6e4ac88aee2
|
|
BLAKE2b-256 checksum How to use checksums |
79c06302ea86c5ddfca60e3131802bfe094179244ac7bcad443b76e84ebbe62f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / purehtml_purescraps-0.1.5-py3-none-any.whl
| Download URL | purehtml_purescraps-0.1.5-py3-none-any.whl |
|---|---|
| Size | 35.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d18e130cb4b237e309b487b91c8769ebbc54b2d95ee627e3bd5834d7e0711671
|
|
BLAKE2b-256 checksum How to use checksums |
a15b92500cab82b4e976982acc07df9d53b95803ec0d4ac31bbd9ee094536fd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for purehtml-purescraps 0.1.5
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for purehtml_purescraps-0.1.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA 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.