fix
This commit is contained in:
1 parent
1473014aca
commit
1246f6a4b2
1 file changed
+4
-1
+4
-1
@@ -42,6 +42,7 @@ class htmlUtils:
|
|||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
ntfy.sendMsg(f"fail 请求失败:{curl}")
|
ntfy.sendMsg(f"fail 请求失败:{curl}")
|
||||||
|
exit()
|
||||||
break
|
break
|
||||||
if type == "None":
|
if type == "None":
|
||||||
data = { curl : url_text}
|
data = { curl : url_text}
|
||||||
@@ -55,7 +56,7 @@ class htmlUtils:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def getJSON(cls,curl):
|
def getJSON(cls,curl):
|
||||||
count = 0
|
count = 0
|
||||||
while count < 5:
|
if count < 5:
|
||||||
try:
|
try:
|
||||||
res = requests.get(curl, headers=cls.headers, timeout=180)
|
res = requests.get(curl, headers=cls.headers, timeout=180)
|
||||||
data_json = res.json()
|
data_json = res.json()
|
||||||
@@ -65,6 +66,8 @@ class htmlUtils:
|
|||||||
count += 1
|
count += 1
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
cls.getJSON(curl)
|
cls.getJSON(curl)
|
||||||
|
else:
|
||||||
|
exit()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def xpathData(cls,c_xpath,url=None,num=None,not_eq=None):
|
def xpathData(cls,c_xpath,url=None,num=None,not_eq=None):
|
||||||
|
|||||||
Reference in new issue
Block a user