Can anyone tell me what error msg "line 1182 in parse" means when I'm trying to parse and xml in python
<p>This is the code that results in an error message:</p>

<pre><code>import urllib
import xml.etree.ElementTree as ET

url = raw_input('Enter URL:')

urlhandle = urllib.urlopen(url)

data = urlhandle.read()

tree = ET.parse(data)
</code></pre>

<p>The error:</p>

<p><img src="https://i.stack.imgur.com/eMKS2.png" alt="error msg screenshot"></p>

<p>I'm new to python. I did read documentation and a couple of tutorials, but clearly I still have done something wrong.  I don't believe it is the xml file itself because it does this to two different xml files.  </p>

<p><code>data</code> is a reference to the XML content as a string, but the <a href="https://docs.python.org/2.7/library/xml.etree.elementtree.html#xml.etree.ElementTree.parse" rel="nofollow"><code>parse()</code></a> function expects a filename or <a href="https://docs.python.org/2/glossary.html#term-file-object" rel="nofollow">file object</a> as argument. That's why there is an an error.</p>

<p><code>urlhandle</code> is a file object, so <code>tree = ET.parse(urlhandle)</code> should work for you. </p>

python xml parsing url elementtree