因为工作需要, 将xml中特定的节点值取出来, 然后统计到excel中。 于是乎试试写了一个python脚本, 加快工作效率。 而且今后还能复用。
以下为完整示例, 需要的朋友们可参考。
示例 XML
<?xml version="1.0" encoding="utf-8"?>
<breakfast_menu>
<food>
<name>Belgian Waffles</name>
<price>$5.95</price>
<description>Two of our famous Belgian Waffles with plenty of real maple syrup</description>
<calories>650</calories>
</food>
<food>
<name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>Light Belgian waffles covered with strawberries and whipped cream</description>

本文介绍如何使用Python的pandas库高效地从XML文件中提取特定节点值,并将其整理成Excel表格。适用于批量处理XML数据,提高工作效率。
最低0.47元/天 解锁文章
24万+

被折叠的 条评论
为什么被折叠?



