11
2- :mod: `HTMLParser ` --- Simple HTML and XHTML parser
3- ==================================================
2+ :mod: `html.parser ` --- Simple HTML and XHTML parser
3+ ===================================================
44
5- .. module :: HTMLParser
5+ .. module :: html.parser
66 :synopsis: A simple parser that can handle HTML and XHTML.
77
88
@@ -18,7 +18,7 @@ in :mod:`sgmllib`.
1818
1919 The :class: `HTMLParser ` class is instantiated without arguments.
2020
21- An HTMLParser instance is fed HTML data and calls handler functions when tags
21+ An :class: ` HTMLParser ` instance is fed HTML data and calls handler functions when tags
2222 begin and end. The :class: `HTMLParser ` class is meant to be overridden by the
2323 user to provide a desired behavior.
2424
@@ -87,8 +87,8 @@ An exception is defined as well:
8787 HREF="http://www.cwi.nl/"> ``, this method would be called as
8888 ``handle_starttag('a', [('href', 'http://www.cwi.nl/')]) ``.
8989
90- All entity references from htmlentitydefs are replaced in the attribute
91- values.
90+ All entity references from :mod: ` html.entities ` are replaced in the
91+ attribute values.
9292
9393
9494.. method :: HTMLParser.handle_startendtag(tag, attrs)
@@ -166,7 +166,7 @@ Example HTML Parser Application
166166As a basic example, below is a very basic HTML parser that uses the
167167:class: `HTMLParser ` class to print out tags as they are encountered::
168168
169- from HTMLParser import HTMLParser
169+ from html.parser import HTMLParser
170170
171171 class MyHTMLParser(HTMLParser):
172172
0 commit comments