fix
This commit is contained in:
parent
058bc23b1a
commit
fe75feafc2
@ -68,9 +68,6 @@ class htmlUtils:
|
|||||||
try:
|
try:
|
||||||
print(f"请求地址:{curl}")
|
print(f"请求地址:{curl}")
|
||||||
res = s.get(curl,stream=True, headers=cls.headers, timeout=10,allow_redirects=True)
|
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":
|
if type == "bytes":
|
||||||
url_text = res
|
url_text = res
|
||||||
if type == "json":
|
if type == "json":
|
||||||
@ -85,6 +82,7 @@ class htmlUtils:
|
|||||||
cls.saveHtml(curl,res.text)
|
cls.saveHtml(curl,res.text)
|
||||||
except:
|
except:
|
||||||
print(f'Retry! 第{count}次')
|
print(f'Retry! 第{count}次')
|
||||||
|
cls.remove_HtmlCache(curl)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
count += 1
|
count += 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user