From 1246f6a4b2fd34ce0492ea5f56ad4811f8e997c6 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Sat, 17 Dec 2022 00:49:54 +0800 Subject: [PATCH] fix --- utils/HtmlUtils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/utils/HtmlUtils.py b/utils/HtmlUtils.py index af94dfa..31bdff2 100644 --- a/utils/HtmlUtils.py +++ b/utils/HtmlUtils.py @@ -42,6 +42,7 @@ class htmlUtils: continue else: ntfy.sendMsg(f"fail 请求失败:{curl}") + exit() break if type == "None": data = { curl : url_text} @@ -55,7 +56,7 @@ class htmlUtils: @classmethod def getJSON(cls,curl): count = 0 - while count < 5: + if count < 5: try: res = requests.get(curl, headers=cls.headers, timeout=180) data_json = res.json() @@ -65,7 +66,9 @@ class htmlUtils: count += 1 time.sleep(1) cls.getJSON(curl) - + else: + exit() + @classmethod def xpathData(cls,c_xpath,url=None,num=None,not_eq=None): if url == None: