With the following code:
import xml.etree.cElementTree as ET
tree = ET.parse(r'https://apitest.batchbook.com/api/v1/people.xml?auth_token=GR5doLv88FrnLyLGIwok')
I get the error message:
IOError Traceback (most recent call last)
<ipython-input-10-d91d452da3e7> in <module>()
----> 1 tree = ET.parse(r'https://apitest.batchbook.com/api/v1/people.xml?auth_token=GR5doLv88FrnLyLGIwok')
<string> in parse(source, parser)
<string> in parse(self, source, parser)
IOError: [Errno 22] invalid mode ('rb') or filename: 'https://apitest.batchbook.com/api/v1/people.xml?auth_token=GR5doLv88FrnLyLGIwok'
However, if I open the link above in a browser, and save this to an XML-file (people.xml), and then do:
tree = ET.parse(r'C:\Users\Eric\Downloads\people.xml')
tree.getroot()
I get the result: <Element 'people' at 0x00000000086AA420>
Any clue as to why using the link does not work? Thanks :)