response 404 requests python compare

The solution for “response 404 requests python compare” can be found here. The following code will assist you in solving the problem.

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

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in