I have just figured out how to search for the element that im looking for in a xml file but now when I run it the code loops through i know 3 times maybe even more. I want to know what im missing that would cause it to loop like that. I just need it to run through get the correct information once.
tree = ET.parse(args.destDir + '/' + 'FACTSentered'+args.fileDate+'.xml')
root=tree.getroot()
codeList = root.findall(".//ScanCodes/ScanCode")
code_stats = {}
for el in codeList:
code = el.find('Code').text
#print code
if code != None:
tree = ET.parse(args.destDir + '/' + 'FACTSentered'+args.fileDate+'.xml')
root=tree.getroot()
codeList = root.findall(".//Order/OrderHeader")
code_stats = {}
for el in codeList:
order = el.find('OrderNumber').text
print order