urllib.error.HTTPError: HTTP Error 403: Forbidden

iMath redstone-cold at 163.com
Mon Dec 24 02:05:47 CET 2012


>>> import urllib.request
>>> response = urllib.request.urlopen('http://en.wikipedia.org/wiki/Internet_media_type')
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    response = urllib.request.urlopen('http://en.wikipedia.org/wiki/Internet_media_type')
  File "C:\Python32\lib\urllib\request.py", line 138, in urlopen
    return opener.open(url, data, timeout)
  File "C:\Python32\lib\urllib\request.py", line 375, in open
    response = meth(req, response)
  File "C:\Python32\lib\urllib\request.py", line 487, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Python32\lib\urllib\request.py", line 413, in error
    return self._call_chain(*args)
  File "C:\Python32\lib\urllib\request.py", line 347, in _call_chain
    result = func(*args)
  File "C:\Python32\lib\urllib\request.py", line 495, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden


why this url generate error ?



More information about the Python-list mailing list