【发布时间】:2018-01-12 18:57:06
【问题描述】:
这是标签的一个例子,但我无法获取标签之间的文本,不能遍历标签,不能使用节点 <seg> 中的 node.text。这就是我问的原因,欢迎所有帮助(对不起我的英语)。
<tuv>
<seg>If you want to save items in a
<bpt i="1"><Message id="Message:1T0000772343:f000012900ce8eb3:MPhS"></bpt>
<ept i="1"></Message></ept>
for which no connection has been established or in a
<bpt i="2"><Message id="Message:1T0000772343:f000012900ceac3d:pvy4"></bpt>
<ept i="2"></Message></ept>
that requires authentication, you need to connect to the library.
</seg>
</tuv>
想要的输出:
如果您想将项目保存在尚未建立连接或需要身份验证的 a 中,则需要连接到库。
【问题讨论】:
标签: python xml xml-parsing lxml