0
我使用Python lxml的閱讀下面的XML文件,但不能得到的節點閱讀使用Python XML文件LXML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<licenses>
<license>
<serial id>1234</serialid>
<key>
<Product>Test Producet</Product>
<Start>Jan</Start>
<key>
</license>
</licenses>
Python代碼
tree = etree.parse('test.slf')
root = tree.getroot()
print 'root = ', root[0][0].findall('key')
#print 'root findall = ', root.getroottree('key')
for node in root.findall('key'):
print node