import urllib.request as ur
import urllib.error as ue
try:
response = ur.urlopen("https://cuiqingcai.com/index.html")
except ue.HTTPError as e:
print(e.reason, e.headers, e.code, sep="\n")
import urllib.request as ur
import urllib.error as ue
try:
response = ur.urlopen("https://cuiqingcai.com/index.html")
except ue.HTTPError as e:
print(e.reason, e.headers, e.code, sep="\n")
转载于:https://www.cnblogs.com/Ychao/p/9336956.html