'strict - raise an exception when a parse error is encountered
tree - a treebuilder class controlling the type of tree that will be
returned. Built in treebuilders can be accessed through
html5lib.treebuilders.getTreeBuilder(treeType)'

def __init__(self, tree=None, strict=False, namespaceHTMLElements=True, debug=False):

    self.strict = strict
    if (tree is None):
        tree = treebuilders.getTreeBuilder(u'etree')
    self.tree = tree(namespaceHTMLElements)
    self.errors = []
    self.phases = dict([(name, cls(self, self.tree)) for (name, cls) in getPhases(debug).items()])
