I read the following: "Deprecated since version 3.2, will be removed in version 3.9: Use list(elem) or iteration." (https://docs.python.org/3.8/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getchildren)
My code works for python 3.8 and below :
tree = ET.parse("....xml")
root = tree.getroot()
getID= (root.getchildren()[0].attrib['ID'])
However, when I try to update it for python 3.9, I am unable to
tree = ET.parse("....xml")
root = tree.getroot()
getID= (root.list(elem)[0].attrib['ID'])
I get the following errors
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'list'