如何用python解析一个网址url生成的xml获取xml中节点的值放在列表中
You can use the xml.dom.minidom library.
http: // docs.python.-org /library/xml.dom.minidom.html
In short:
from xml.dom.minidom import parse
dom1 = parse("your url")
# travel through dom1 to get what you want
from xml.etree import ElementTree as ET
tree = ET.parse('C:\\test.xml')
p = tree.findall('//*')
l = []
for i in p:
l.append[i.tag]
C:\\test.xml 是你要分析的xml文件