Registry / htmlparser

htmlparser

JSON →
library0.0.2pypypiunverified

Backport of Python 2.7's HTMLParser to earlier versions. Version 0.0.2 is the latest release, with no active development. Intended for legacy Python 2.x compatibility only; not maintained for Python 3.

pip install htmlparser
INSTALL
IMPORT
SIG · HTMLPARSER
H
htmlparser
pythonv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

HTMLParser
from htmlparser import HTMLParser
from HTMLParser import HTMLParser
Python 2.7 standard library used 'HTMLParser' as module name; this backport uses lowercase 'htmlparser'.

Subclass HTMLParser and override handler methods. Works like Python 2.7's HTMLParser.

from htmlparser import HTMLParser class MyParser(HTMLParser): def handle_starttag(self, tag, attrs): print("Start tag:", tag) parser = MyParser() parser.feed('<html><head><title>Test</title></head></html>')
Debug
Known issues
breakingThis library is a backport of Python 2.7's HTMLParser. It is not compatible with Python 3. Do not use in Python 3 projects.
fix
Use Python 3's built-in html.parser.HTMLParser instead.
affects: all
deprecatedThe library is unmaintained since 2012. No bug fixes or security patches are expected.
fix
Migrate to Python 3's html.parser or consider using html5lib for modern HTML parsing.
affects: all
Upgrade
Version history
0.0.2latest on PyPI · released Mar 1, 2013
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
htmlparser — pip install htmlparser · libregistry