P
P
Peter Pitaev2021-01-26 22:05:15
Python
Peter Pitaev, 2021-01-26 22:05:15

Python requests exits in except with response code 200 (OK)?

Hello.

I send requests through python requestsusing a proxy, it returns a status of 200 (OK), but some requests go to except.

Code example:

import requests

try:
    r = requests.get(url, proxies=proxies, timeout=5)
except:
    print(r.status_code)


I tested, if it knocks out exceptwith a status code of 200 (OK), the request does not reach the requested resource.

What's wrong, I don't understand.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question