📅  最后修改于: 2022-03-11 14:48:23.329000             🧑  作者: Mango
Look at the r.status_code attribute:
if r.status_code == 404:
# A 404 was issued.
e.g.:
>>> import requests
>>> r = requests.get('http://httpbin.org/status/404')
>>> r.status_code
404