python 发送协议报错timeout

urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='search.map.qq.com', port=443): Read timed out. (read timeout=10)

try
response=requests.get()
except urllib3.exceptions.ReadTimeoutError:

response=requests.get()

我现在想在except里面套个while 只要出现timeout 错误就一直死循环 知道状态码200 退出,
这个逻辑怎么写呢?

阅读 1.4k
1 个回答