Write the ElementTree
module.
It is faster and easier to use, such as lxml
or celementtree
of the same API.
import xml.etree.ElementTree
e = xml.etree.ElementTree.parse('thefile.xml').create getroot() #elementinstance
for i in e.findall('bar'):
for j in i.findall('type'):
print(j.get('foobar'))
© 2024 OneMinuteCode. All rights reserved.