mirror of
https://gitee.com/fasiondog/hikyuu.git
synced 2024-12-02 03:48:19 +08:00
重复用一个代理ip,当超时6次换ip
This commit is contained in:
parent
787b185794
commit
fb95b5e537
@ -27,8 +27,9 @@ def request_with_proxy(url):
|
||||
result = requests.get(url, proxies=proxies, timeout=5).text
|
||||
#hku_info("use proxy: {}".format(proxies['http']))
|
||||
return result
|
||||
except:
|
||||
new = True
|
||||
except Exception as e:
|
||||
if i == 6:
|
||||
new = True
|
||||
time.sleep(2)
|
||||
raise Exception("无法通过代理访问!")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user