{"id":27047,"library":"htmlparser","title":"HTMLParser","description":"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.","status":"abandoned","version":"0.0.2","language":"python","source_language":"en","source_url":"https://github.com/PolicyStat/HTMLParser","tags":["html","parser","backport","legacy","python2"],"install":[{"cmd":"pip install htmlparser","lang":"bash","label":"latest"}],"dependencies":[],"imports":[{"note":"Python 2.7 standard library used 'HTMLParser' as module name; this backport uses lowercase 'htmlparser'.","wrong":"from HTMLParser import HTMLParser","symbol":"HTMLParser","correct":"from htmlparser import HTMLParser"}],"quickstart":{"code":"from htmlparser import HTMLParser\n\nclass MyParser(HTMLParser):\n    def handle_starttag(self, tag, attrs):\n        print(\"Start tag:\", tag)\n\nparser = MyParser()\nparser.feed('<html><head><title>Test</title></head></html>')","lang":"python","description":"Subclass HTMLParser and override handler methods. Works like Python 2.7's HTMLParser."},"warnings":[{"fix":"Use Python 3's built-in html.parser.HTMLParser instead.","message":"This library is a backport of Python 2.7's HTMLParser. It is not compatible with Python 3. Do not use in Python 3 projects.","severity":"breaking","affected_versions":"all"},{"fix":"Migrate to Python 3's html.parser or consider using html5lib for modern HTML parsing.","message":"The library is unmaintained since 2012. No bug fixes or security patches are expected.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from htmlparser import HTMLParser' (note lowercase 'h').","cause":"Trying to import using the Python 2.7 standard library module name (uppercase) instead of the backport module name (lowercase).","error":"ImportError: No module named HTMLParser"},{"fix":"Install with 'pip install htmlparser' for Python 2, or use Python 3's built-in 'html.parser' module.","cause":"The backport package is not installed or is not available for Python 3.","error":"ImportError: No module named htmlparser"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}