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 个回答
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进