Gumbo
An HTML5 parsing library in pure C99
...It's designed to serve as a building block for other tools and libraries such as linters, validators, templating languages, and refactoring and analysis tools. Gumbo gains some of this by virtue of being written in C, but it is not an important consideration for the intended use-case, and was not a major design factor. Gumbo is intentionally designed to turn an HTML document into a parse tree, and free that parse tree all at once. To install the python bindings, make sure that the C library is installed first, and then sudo python setup.py install from the root of the distro. ...