如何使用Python将html标记解析为Unicode字符

如何使用Python将html标记解析为Unicode字符,python,html,xml,parsing,Python,Html,Xml,Parsing,我有一个XML文档,在一些文本元素中有html标记,如下所示: <my-element><p>This is an XML element<br/> with HTML markup and chemical formulas <br/> like water H<sub>2</sub>O, scientific notation like 1.32 x 10<sup>4</sup>, and oth

我有一个XML文档,在一些文本元素中有html标记,如下所示:

<my-element><p>This is an XML element<br/>
with HTML markup and chemical formulas <br/>
like water H<sub>2</sub>O, scientific notation like 1.32 x 10<sup>4</sup>, and other super- and <br/>
sub-script c<sub>h</sub><sup>a</sup><sub>r</sub><sup>a</sup>c<sub>t</sup><sub>e</sub><sup>r</sup><sub>s</sub> <sup>i</sup><sup>n</sup> Unicode.</p></my-element>
This is an element
with HTML markup and chemical formulas 
like water H₂O, scientific notation like 1.32 x 10³, and all super- and 
sub-script cₕₐᵣₐcₜₑᵣₛ ⁱⁿ Unicode.

是否还有其他库可以提供帮助?

可用的unicode超级和下标集似乎不完整:与编程语言无关,您无法表示可以用html呈现的所有子和上标。谢谢,Sebastian,这很有帮助。是否有人知道有任何Python库对现有的Unicode字符进行转换,或者我必须自己进行转换?