From 2bde1350de3247a9b31801b8b39857f17bcd7e98 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Fri, 9 Dec 2022 12:40:58 +0800 Subject: [PATCH] fix --- utils/HtmlUtils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/utils/HtmlUtils.py b/utils/HtmlUtils.py index b0faf85..fd19306 100644 --- a/utils/HtmlUtils.py +++ b/utils/HtmlUtils.py @@ -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: