[Solved] Python request Error: requests.exceptions.ReadTimeout: HTTPSConnectionPool (xxxx)

Screenshot of the problem:

Mental process

First, the request parameters are determined. The URLs are consistent, but an error is reported

Method 1:

import requests

requests. get(‘ https://www.google.com/ ‘,verify=False)

If it’s not solved, it’s not the agent’s reason

Method 2:

session = requests. session()

session. keep_ Alive = false # close redundant connections

Using session error reporting session request

It still hasn’t been solved. Generally, it can be solved at this step, but an error is still reported when executing python

Finally, I found that I was out of my mind. Since the header request header directly copies other items, just annotate the “content length”: “143” in it. Only remember that the header in the later step is better to use the header of the current interface. You can delete redundant values yourself. It’s not convenient to pull an item from other items, which will increase the troubleshooting time

Similar Posts: