fix
This commit is contained in:
parent
bbb86fda72
commit
c489085ce1
@ -63,9 +63,12 @@ class htmlUtils:
|
||||
except: url_text = None
|
||||
if url_text != None and update == False: return html.fromstring(url_text)
|
||||
else: url_text = None
|
||||
while url_text == None:
|
||||
repeat = 0
|
||||
while url_text == None and repeat <=5:
|
||||
repeat+=1
|
||||
print(f"请求地址:{curl}")
|
||||
res = s.get(curl,stream=True, headers=cls.headers, timeout=5,allow_redirects=True)
|
||||
try: res = s.get(curl,stream=True, headers=cls.headers, timeout=5,allow_redirects=True)
|
||||
except: print(f"请求失败:{curl}")
|
||||
if type == "bytes":
|
||||
url_text = res
|
||||
if type == "json":
|
||||
|
||||
Loading…
Reference in New Issue
Block a user