Commit 11ee49af by Peng

no message

parent 0c4f4ead
......@@ -153,7 +153,7 @@ class GetStockImgId(object):
# last_date = '2023-12-31'
print(f"Start Date: {start_date}")
print(f"Last Date: {last_date}")
num = 0
while is_continue:
try:
response = self.get_url_month(page, cookie, str(start_date), str(last_date))
......@@ -170,8 +170,12 @@ class GetStockImgId(object):
time.sleep(random.randint(3, 6))
page += 1
else:
num+=1
print(f'状态码为{response.status_code}, 请求失败')
raise
time.sleep(random.randint(6, 15))
if num >5:
raise
continue
except Exception as e:
print(e)
# 抛出异常以停止外层循环
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment