Last active
December 4, 2020 16:13
-
-
Save MartinThoma/d252cc68f0cf9c0c86bec00c689503e7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
xml = """<root>Hello World!</root>""" | |
parser = etree.XMLParser() | |
doc = etree.fromstring(xml.encode(), parser) | |
parsed_xml = etree.tostring(doc).decode("utf8") | |
print(parsed_xml) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment