|
if (str(r) == '<Response [404]>'): |
Use a proper way to process request's response according to documentation.
Don't use string representation - it is not reliable.
Use like this:
r.status_code == requests.codes.ok
http://docs.python-requests.org/en/latest/user/quickstart/#response-status-codes