I am trying to access and manipulate the data of the web page. For primary testing purpose I used the w3schools websit but I am unable to access the content using following code:
import urllib as url
import xml.etree.ElementTree as et
web_data = url.urlopen("www.w3schools.com/xml/cd_catalog.xml")
str_data = web_data.read()
print str_data
These are the errors I am getting :
Traceback (most recent call last):
File "C:\Python27\webpage.htlm.py", line 4, in <module>
web_data = url.urlopen("www.w3schools.com/xml/cd_catalog.xml")
File "C:\Python27\lib\urllib.py", line 87, in urlopen
return opener.open(url)
File "C:\Python27\lib\urllib.py", line 213, in open
return getattr(self, name)(url)
File "C:\Python27\lib\urllib.py", line 469, in open_file
return self.open_local_file(url)
File "C:\Python27\lib\urllib.py", line 483, in open_local_file
raise IOError(e.errno, e.strerror, e.filename)
IOError: [Errno 2] The system cannot find the path specified: 'www.w3schools.com\\xml\\cd_catalog.xml'
open_file/open_local_filemeans it's looking for that file on your computer, not on the internet...http://...