The htmllib Module
The htmllib
module supplies a class named HTMLParser
that subclasses SGMLParser
and defines start_
tag
, do_
tag
, and end_
tag
methods for HTML 2.0 tags. HTMLParser
implements and overrides methods to perform calls to methods of a formatter object, covered in “The formatter Module” in The htmllib Module. You can subclass HTMLParser
and override methods. In addition to start_
tag
, do_
tag
, and end_
tag
methods, an instance h
of HTMLParser
supplies the following attributes and methods.
anchor_bgn |
Called for each |
anchor_end |
Called for each |
anchorlist | The |
formatter | The |
Get Python in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.