301 moved permanently
302 found
303 not modified
400 bad request
401 unauthorized
403 forbidden
404 not found
500 internal server error
501 not implementedh
URLError >HTTPError
URLError: not linked the internal server: no web connection; remote url not exit; HTTPError
******************************************
import urllib.error
import urllib.request
try:
urllib.request.urlopen("http://blog.cssdn.net")
except urllib.error.URLError as e:
if hasattr(e,"code"):
print(e.code)
if hasattr(e,"reason"):
print(e.reason)