Answer the question
In order to leave comments, you need to log in
Why is there a not well-formed (invalid token) error when parsing a file?
there is a folder in which there are several xml files, I try to parse them in a loop with this code:
import xml.etree.ElementTree as ET
import os
import io
xml_dir = '/home/blizzard/Documents/edi_royal canin/'
for file in os.listdir(xml_dir):
if file.endswith('.xml'):
tree = ET.parse(xml_dir+file)
path = '/home/blizzard/Documents/edi_royal canin/40-download-2018-01-12-11-18-09-3329_MZP.xml'
tree = ET.parse(path)
root = tree.getroot()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question