class XHTMLParser(etree.XMLParser):
An XML parser that is configured to return lxml.html Element objects.
Note that this parser is not really XHTML aware unless you let it load a DTD that declares the HTML entities. To do this, make sure you have the XHTML DTDs installed in your catalogs, and create the parser like this:
>>> parser = XHTMLParser(load_dtd=True)
If you additionally want to validate the document, use this:
>>> parser = XHTMLParser(dtd_validation=True)
For catalog support, see http://www.xmlsoft.org/catalog.html.
Method | __init__ |
Undocumented |