Код: Выделить всё
def parse_xml(file_path):
with open(file_path,'rb') as f:
dict_data = xmltodict.parse(f.read())
Код: Выделить всё
for files in os.listdir('/Users/dp/Dropbox/Data/Moody-xbrl'):
parse_xml(files)
Код: Выделить всё
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/xmltodict.py", line 378, in parse
parser.Parse(xml_input, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 1, column 0
Подробнее здесь: https://stackoverflow.com/questions/733 ... t-if-i-run