Skip to main content

htmlpyever

htmlpyever is a very single-minded binding to html5ever. You can:

  • Feed the parser:

    parser.feed(b'hOI wURLD!')
  • Get a callback when the parser encounters a closing script tag:

    def script_callback(script):
        # handle script
    parser = htmlpyever.Parser(script_callback)
    
    # or
    
    class MyParser(htmlpyever.Parser):
        def run_script(self, script)
            # handle script
    parser = MyParser()
  • Obtain the result as an LXML Element or ElementTree:

    from lxml import etree
    etree.tostring(parser.root)
    # >>> '<html><head/><body>hOI! wURLD!</body></html>'
    etree.tostring(parser.root)
    # >>> '<html><head/><body>hOI! wURLD!</body></html>'
    # not sure why the doctype doesn't show up in the serialized ElementTree

That’s it.

Metadata

Release files for htmlpyever 0.1.0.post3

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

Source distribution (sdist)

Source distribution for htmlpyever 0.1.0.post3
File Size Uploaded Provenance Actions
htmlpyever-0.1.0.post3.tar.gz 49.3 kB Without provenance Details for htmlpyever-0.1.0.post3.tar.gz

Release files / htmlpyever-0.1.0.post3.tar.gz

Download URL htmlpyever-0.1.0.post3.tar.gz
Size 49.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d09e54287be121c87abf238425aaeedb307e6f78b1c0daf6236047b4c375b943
BLAKE2b-256 checksum
How to use checksums
1a9cde8e025029299fa7e9c4ba55860673826e645a16dfa692d5fa86c998e977
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for htmlpyever 0.1.0.post3

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