This commit is contained in:
caiwx86 2023-03-31 22:47:12 +08:00
parent 058bc23b1a
commit fe75feafc2

View File

@ -68,9 +68,6 @@ class htmlUtils:
try:
print(f"请求地址:{curl}")
res = s.get(curl,stream=True, headers=cls.headers, timeout=10,allow_redirects=True)
if res.status_code != 200:
cls.remove_HtmlCache(curl)
continue
if type == "bytes":
url_text = res
if type == "json":
@ -85,6 +82,7 @@ class htmlUtils:
cls.saveHtml(curl,res.text)
except:
print(f'Retry! 第{count}')
cls.remove_HtmlCache(curl)
time.sleep(1)
traceback.print_exc()
count += 1