Metadata-Version: 2.4
Name: htmlparser2
Version: 0.0.4
Summary: A faithful-shape Python port of htmlparser2, backed by domonic DOM nodes
Author-email: byteface <byteface@googlemail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/byteface/domonic-libs/tree/master/src/htmlparser2
Project-URL: Source, https://github.com/byteface/domonic-libs
Project-URL: Documentation, https://github.com/byteface/domonic-libs/blob/master/docs/htmlparser2.md
Project-URL: Tracker, https://github.com/byteface/domonic-libs/issues
Keywords: html,parser,htmlparser2,dom,domonic
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Markup :: HTML
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: domonic>=1.7.0
Dynamic: license-file

# htmlparser2

A faithful-shape Python port of [`fb55/htmlparser2`](https://github.com/fb55/htmlparser2),
backed by domonic DOM nodes.

```bash
pip install htmlparser2
htmlparser2 page.html --stats
cat page.html | htmlparser2 --text
```

```python
from htmlparser2 import DomUtils, parseDocument

doc = parseDocument("<ul><li>One<li>Two</ul>")
print(DomUtils.textContent(doc))
```

It can also register itself as a domonic parser backend:

```python
from domonic import domonic
from htmlparser2 import install_domonic_parser

install_domonic_parser()
page = domonic.parseString("<main><h1>Hello</h1></main>", parser="htmlparser2")
```

This package is built from the same repository as `domonic-libs`, but ships as
its own top-level import so the umbrella package does not own the parser source.
