def parse(doc, treebuilder="<STR_LIT>", encoding=None,<EOL>namespaceHTMLElements=True):
tb = treebuilders.getTreeBuilder(treebuilder)<EOL>p = HTMLParser(tb, namespaceHTMLElements=namespaceHTMLElements)<EOL>return p.parse(doc, encoding=encoding)<EOL>
Parse a string or file-like object into a tree