使用python从文本文件中仅获取xml数据

问题描述

我有一个文本文件,其中有一些XML数据和一些HTML数据。两者均以“

文件示例:

xyz data:
<note>
<to>john</to>
<from>doe</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

xyz data
<bold>xyz</bold>

text 
text 
text

<bold>xyz</bold>

again XML data

注意:此文件为.txt格式。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)