Lines Matching refs:HTMLParser
2 :mod:`HTMLParser` --- Simple HTML and XHTML parser
5 .. module:: HTMLParser
10 The :mod:`HTMLParser` module has been renamed to :mod:`html.parser` in Python
21 **Source code:** :source:`Lib/HTMLParser.py`
25 This module defines a class :class:`.HTMLParser` which serves as the basis for
31 .. class:: HTMLParser()
33 An :class:`.HTMLParser` instance is fed HTML data and calls handler methods
35 encountered. The user should subclass :class:`.HTMLParser` and override its
38 The :class:`.HTMLParser` class is instantiated without arguments.
48 :class:`.HTMLParser` is able to handle broken markup, but in some cases it
60 :class:`.HTMLParser` class to print out start tags, end tags and data
63 from HTMLParser import HTMLParser
66 class MyHTMLParser(HTMLParser):
99 :class:`.HTMLParser` Methods
102 :class:`.HTMLParser` instances have the following methods:
105 .. method:: HTMLParser.feed(data)
113 .. method:: HTMLParser.close()
118 the :class:`.HTMLParser` base class method :meth:`close`.
121 .. method:: HTMLParser.reset()
127 .. method:: HTMLParser.getpos()
132 .. method:: HTMLParser.get_starttag_text()
142 implementations do nothing (except for :meth:`~HTMLParser.handle_startendtag`):
145 .. method:: HTMLParser.handle_starttag(tag, attrs)
163 .. method:: HTMLParser.handle_endtag(tag)
170 .. method:: HTMLParser.handle_startendtag(tag, attrs)
178 .. method:: HTMLParser.handle_data(data)
184 .. method:: HTMLParser.handle_entityref(name)
191 .. method:: HTMLParser.handle_charref(name)
199 .. method:: HTMLParser.handle_comment(data)
211 .. method:: HTMLParser.handle_decl(decl)
220 .. method:: HTMLParser.handle_pi(data)
229 The :class:`.HTMLParser` class uses the SGML syntactic rules for processing
234 .. method:: HTMLParser.unknown_decl(data)
251 from HTMLParser import HTMLParser
254 class MyHTMLParser(HTMLParser):
334 Feeding incomplete chunks to :meth:`~HTMLParser.feed` works, but
335 :meth:`~HTMLParser.handle_data` might be called more than once::