I'm trying to get publish date from XML file. please see my xml file.
<sdnList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/sdnList.xsd">
<publshInformation>
<Publish_Date>06/10/2021</Publish_Date>
<Record_Count>8954</Record_Count>
</publshInformation>
</sdnList>
I'm trying below way but its not working and I don't want to use for loop for simple file. Thanks
import xml.etree.ElementTree as ET
tree = ET.parse("test.xml")
root = tree.getroot()
publish_Date = root.findall("Publish_Date")
for pdate in publish_Date:
print(pdate.text)