1 #!/usr/bin/env python 2 3 import libxml2dom 4 5 html = "<bad" 6 7 print libxml2dom.parseString(html, html=True) 8 9 # vim: tabstop=4 expandtab shiftwidth=4