我正在使用ElementTree来处理一些html。我认为html是一种xml语言,所以应该可以。你知道吗
在html中,文本中可以有标记:
<p>
This paragraph <em>has some</em> emphasised words.
</p>
所以“p”元素有一些文本(“这个段落”),一个子元素(“em”)和更多的文本(“强调词”)
但是ElementTree元素有一个文本属性,它是一个字符串。子元素在一个列表中,但是文本都在一个字符串中。你知道吗
如何在ElementTree中表示这个html?有可能吗?你知道吗
Tags:
你想解析它吗?你知道吗
提供:
或者你想修改HTML?你知道吗
提供:
相关问题 更多 >
编程相关推荐