. Advertisement .
..3..
. Advertisement .
..4..
How can I catch response 404 error with requests.get in python?
Here are a few suggestions for youresponse = requests.get('https://api.github.com')
if response.status_code == 200:
print('Success!')
elif response.status_code == 404:
print('Not Found.')
If you want something super simple