Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

htmlpyever

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmlpyever

Python bindings to html5ever

  • 0.1.0.post3
  • PyPI
  • Socket score

Maintainers
1

htmlpyever

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

  • Feed the parser:

    .. code-block:: python

    parser.feed(b'hOI wURLD!')

  • Get a callback when the parser encounters a closing script tag:

    .. code-block:: python

    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:

    .. code-block:: python

    from lxml import etree etree.tostring(parser.root)

    >>> 'hOI! wURLD!'

    etree.tostring(parser.root)

    >>> 'hOI! wURLD!'

    not sure why the doctype doesn't show up in the serialized ElementTree

That's it.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc