* Parses valid and invalid HTML documents to a tree
* Support for minidom, ElementTree (including cElementTree and lxml.etree), BeautifulSoup (deprecated) and custom simpletree output formats
* DOM to SAX converter
* Reports parse errors
* Character encoding detection
* Filtering and serializing of trees
* HTML+CSS sanitizer
* Many unit tests
* Parses valid and invalid HTML documents to a tree
* Support for minidom, ElementTree (including cElementTree and lxml.etree),
BeautifulSoup (deprecated) and custom simpletree output formats
* DOM to SAX converter
* Reports parse errors
* Character encoding detection
* Filtering and serializing of trees
* HTML+CSS sanitizer
* Many unit tests
html5lib is a pure-python library for parsing HTML. The parser is
designed to handle all flavours of HTML and parses invalid documents
using well-defined error handling rules compatible with the behaviour of
major desktop web browsers.
Output is to a tree structure; the current release supports output to
DOM, ElementTree, lxml and BeautifulSoup tree formats as well as a
simple custom format.