看代码;

利用urlopen中的超时参数设立一个循环

while True:
    try:
        page = urllib.request.urlopen(url, timeout=3)
        break
    except:
        tracebake.print_exc()

  

相关文章:

  • 2022-12-23
  • 2023-02-02
  • 2021-10-18
  • 2021-07-13
  • 2021-05-25
  • 2022-12-23
  • 2021-09-23
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-07-28
  • 2022-01-22
  • 2022-12-23
相关资源
相似解决方案