fix
This commit is contained in:
parent
d7fcf19bf6
commit
2bde1350de
@ -25,10 +25,10 @@ class htmlUtils:
|
||||
count = 1
|
||||
#数据为空则获取数据
|
||||
while url_text == None:
|
||||
if count < 5 and url_text == None:
|
||||
if count <= 10:
|
||||
try:
|
||||
print("请求地址:",curl)
|
||||
res = s.get(curl,stream=True, headers=cls.headers, timeout=20)
|
||||
res = s.get(curl,stream=True, headers=cls.headers, timeout=50)
|
||||
if type == "bytes":
|
||||
url_text = res
|
||||
else:
|
||||
@ -55,7 +55,7 @@ class htmlUtils:
|
||||
def getJSON(cls,curl):
|
||||
while True:
|
||||
try:
|
||||
res = requests.get(curl, headers=cls.headers,timeout=30)
|
||||
res = requests.get(curl, headers=cls.headers,timeout=50)
|
||||
data_json = res.json()
|
||||
return data_json
|
||||
except:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user