I try to parse a nfo file and print in a html code style (a table).
I tried with xml.etree
but i get only 2 elements: Metadata
and Category
.
This is how a .nfo looks like:
<?xml version="1.0"?>
<MsInfo>
<Metadata>
<Version>8.0</Version>
<CreationUTC>12/02/15 10:45:25</CreationUTC>
</Metadata>
<Category name="System Summary">
<Data>
<Item><![CDATA[OS Name]]></Item>
<Value><![CDATA[Microsoft Windows 8.1 Pro]]></Value>
</Data>
</Category>
</MsInfo>
My code looks like:
tree = ET.parse(File)
root = tree.getroot()
for element in root.findall('Category'):
value = element.find('Data')
print element.attrib
But only print Category element
, my question is how i can get values from Data
?
Thanks!