From ef794f90211ea1e8e25352b3eaac2e25c4e91c1f Mon Sep 17 00:00:00 2001 From: theRealProHacker <77074862+theRealProHacker@users.noreply.github.com> Date: Mon, 20 Feb 2023 18:23:56 +0100 Subject: [PATCH] Fixed error --- html5lib/html5parser.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/html5lib/html5parser.py b/html5lib/html5parser.py index 74d829d9..2be20534 100644 --- a/html5lib/html5parser.py +++ b/html5lib/html5parser.py @@ -115,6 +115,9 @@ def __init__(self, tree=None, strict=False, namespaceHTMLElements=True, debug=Fa if tree is None: tree = treebuilders.getTreeBuilder("etree") + elif isinstance(tree, str): + tree = treebuilders.getTreeBuilder(tree) + self.tree = tree(namespaceHTMLElements) self.errors = []