I am really an ETL guy trying to learn Python, please help
import urllib2
urls =urllib2.urlopen("url1","url2")
i=0
while i< len(urls):
htmlfile = urllib2.urlopen(urls[i])
htmltext = htmlfile.read()
print htmltext
i+=1
I am getting errors as
Traceback (most recent call last): File ".\test.py", line 2, in urls =urllib2.urlopen("url1","url2") File "c:\python27\Lib\urllib2.py", line 154, in urlopen return opener.open(url, data, timeout) File "c:\python27\Lib\urllib2.py", line 437, in open response = meth(req, response) File "c:\python27\Lib\urllib2.py", line 550, in http_response 'http', request, response, code, msg, hdrs) File "c:\python27\Lib\urllib2.py", line 475, in error return self._call_chain(*args) File "c:\python27\Lib\urllib2.py", line 409, in _call_chain result = func(*args) File "c:\python27\Lib\urllib2.py", line 558, in http_error_default raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) urllib2.HTTPError: HTTP Error 405: Method Not Allowed