diff --git a/code_select.py b/code_select.py index b095d62..8e8f643 100755 --- a/code_select.py +++ b/code_select.py @@ -19,7 +19,12 @@ else: def parse_text_content(element): - root = ET.fromstring(element) + # https://stackoverflow.com/a/35591507/15245191 + magic = ''' + ]>''' + root = ET.fromstring(magic + element) text = ET.tostring(root, encoding="unicode", method="text") text = html.unescape(text) return text