html5lib is a pure-python library for parsing HTML. It is designed to
conform to the HTML 5 specification, which has formalized the error handling
algorithms of popular web browsers.

 = Installation =

html5lib is packaged with setuptools. To install it use:
 $ python setup.py install

 = Tests =

You may wish to check that your installation has been a success by
running the testsuite. All the tests can be run by invoking
runtests.py in the tests/ directory or by running
$ python setup.py test

 = Parsing HTML =

Simple usage follows this pattern:

import html5lib
f = open("mydocument.html")
parser = html5lib.HTMLParser()
document = parser.parse(f)

More extensive documentation on html5lib including on how to generate trees in
well known formats (including minidom, ElementTree and BeautifulSoup) and
how to serialize trees and how to use the HTML sanitizer can be found on the
wiki page:
http://code.google.com/p/html5lib/wiki/UserDocumentation

 = Bugs =

Please report any bugs on the issue tracker:
http://code.google.com/p/html5lib/issues/list

 = Get Involved =

Contributions to code or documentation are actively encouraged. Submit
patches to the issue tracker or discuss changes on irc in the #whatwg
channel on freenode.net

