Commit 3d4012f4 authored by 邱阿朋's avatar 邱阿朋

优化

parent fbef146a
...@@ -28,7 +28,12 @@ page.set.download_path(download_path) ...@@ -28,7 +28,12 @@ page.set.download_path(download_path)
# 忽略 openpyxl 样式警告 # 忽略 openpyxl 样式警告
warnings.filterwarnings("ignore", category=UserWarning, module="openpyxl") warnings.filterwarnings("ignore", category=UserWarning, module="openpyxl")
while True: def page_get(url):
host = domain.switch_domain(country)
full_url = host + url
page.get(full_url, timeout=3)
while True:
time.sleep(1) time.sleep(1)
title = page.title title = page.title
if title == "Amazon Sign-In": if title == "Amazon Sign-In":
......
...@@ -22,7 +22,12 @@ helper.make_dir(download_path) ...@@ -22,7 +22,12 @@ helper.make_dir(download_path)
# 设置下载路径,确保在打开浏览器前设置 # 设置下载路径,确保在打开浏览器前设置
page.set.download_path(download_path) page.set.download_path(download_path)
while True: def page_get(url):
host = domain.switch_domain(country)
full_url = host + url
page.get(full_url, timeout=3)
while True:
time.sleep(1) time.sleep(1)
title = page.title title = page.title
if title == "Amazon Sign-In": if title == "Amazon Sign-In":
......
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