Im new using Python, now I have a problem using ElementTree and read out values from an xml with this structure:
<entry number="47" date="2011-01-29">
<name>Swedbank-taxe</name>
<row account="1930" debit="0" credit="16712"/>
<row account="8415" debit="1781" credit="0"/>
<row account="2734" debit="14931" credit="0"/>
</entry>
<entry number="48" date="2011-01-29">
<name>Agri - Calcium</name>
<row account="1930" debit="0" credit="2000"/>
<row account="1471" debit="400" credit="0"/>
<row account="4370" debit="1600" credit="0"/>
</entry>
With this code I try to print out the content of every row with the label="row":
from tkinter import filedialog
from xml.etree.ElementTree import ElementTree as ET
xmltree = ET()
filval=filedialog.askopenfilename()
xmltree.parse(filval)
konton = xmltree.getiterator('row')
for i in konton:
print (i.text)
But the only print out is None.
Do you know what I'm doing wrong?
Also I would like to print out every row with account="1930". In this case I would like a print out like this:
1930
1930