I am trying to use the Element Tree modules but I end up to some Error which I can't understand.
My code here is based on the Python documentation itself, Python Element Tree doc ,somehow it gave me an error when trying to run the script;
try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET file_name_xml = "curl-result.xml" tree = ET.parse(file_name_xml) tree.getroot() When I run this code:
./python2.6 modify_xml_file.py Then, it gave me this error;
Traceback (most recent call last): File "modify_xml_file.py", line 8, in <module> tree = ET.parse(file_name_xml) File "<string>", line 45, in parse File "<string>", line 32, in parse SyntaxError: not well-formed (invalid token): line 1, column 4