Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

htmlparser2-0.0.4-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

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

Hashes for htmlparser2-0.0.4.tar.gz
Algorithm Hash digest
SHA256 6a2dc2d57837e2b52e1bfb23d245bc0a54ebbef42a18ccb875a823284f5a0a0d
MD5 b87ffc4cb30c31e48459e5a525f80e67
BLAKE2b-256 6d02a385a3dc3873ec12dd5735eae2a62398d9cb3fe46bf3ee20b9e4afec2590

See more details on using hashes here.

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

Hashes for htmlparser2-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9b10cf8e1bce758f07fa6959d61fb1a536fbeb7e4ff4c21e2a151b472f096862
MD5 6b912b7a1763bfd7abb1662e568ec56c
BLAKE2b-256 888072517e75db227fc12c112bd3b174474ccdb7b7ca8693819d4b4149fdb247

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 files

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