htmlparser2
A faithful-shape Python port of fb55/htmlparser2,
backed by domonic DOM nodes.
pip install htmlparser2
htmlparser2 page.html --stats
cat page.html | htmlparser2 --text
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:
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
htmlparser2-0.0.4.tar.gz
(20.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file htmlparser2-0.0.4.tar.gz.
File metadata
- Download URL: htmlparser2-0.0.4.tar.gz
- Upload date:
- Size: 20.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a2dc2d57837e2b52e1bfb23d245bc0a54ebbef42a18ccb875a823284f5a0a0d
|
|
| MD5 |
b87ffc4cb30c31e48459e5a525f80e67
|
|
| BLAKE2b-256 |
6d02a385a3dc3873ec12dd5735eae2a62398d9cb3fe46bf3ee20b9e4afec2590
|
File details
Details for the file htmlparser2-0.0.4-py3-none-any.whl.
File metadata
- Download URL: htmlparser2-0.0.4-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b10cf8e1bce758f07fa6959d61fb1a536fbeb7e4ff4c21e2a151b472f096862
|
|
| MD5 |
6b912b7a1763bfd7abb1662e568ec56c
|
|
| BLAKE2b-256 |
888072517e75db227fc12c112bd3b174474ccdb7b7ca8693819d4b4149fdb247
|