# lxml转Html from lxml import etree from HTMLParser import HTMLParser def lxml_to_html(text:etree): content = etree.tostring(text, method='html') return HTMLParser().unescape(content)