I try to get the source-code of a webpage with python and the library urllib
unfortunately if my URL is not secured (https://)
I get an error 401:
File "C:\Python27\ArcGIS10.1\lib\urllib.py", line 379, in http_error_default
raise IOError, ('http error', errcode, errmsg, headers)
IOError: ('http error', 401, 'Unauthorized', <httplib.HTTPMessage instance at 0x031279E0>)
For example this code give me this error:
import urllib
url = 'http://python.org/'
req = urllib.urlopen(url)
but this code work fine:
import urllib
url = 'https://python.org/'
req = urllib.urlopen(url)
I can access to this website without any problems through my browser but I'm unable to get the source code via python.
Any Ideas ?