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

优化

parent fbef146a
...@@ -28,17 +28,22 @@ page.set.download_path(download_path) ...@@ -28,17 +28,22 @@ 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):
time.sleep(1) host = domain.switch_domain(country)
title = page.title full_url = host + url
if title == "Amazon Sign-In": page.get(full_url, timeout=3)
print("请登录账号")
continue while True:
try: time.sleep(1)
page.ele("#cvf-submit-otp-button-announce") title = page.title
print("请输入验证码") if title == "Amazon Sign-In":
except ElementNotFoundError: print("请登录账号")
break continue
try:
page.ele("#cvf-submit-otp-button-announce")
print("请输入验证码")
except ElementNotFoundError:
break
def export_list_read_data(): def export_list_read_data():
......
...@@ -22,17 +22,22 @@ helper.make_dir(download_path) ...@@ -22,17 +22,22 @@ helper.make_dir(download_path)
# 设置下载路径,确保在打开浏览器前设置 # 设置下载路径,确保在打开浏览器前设置
page.set.download_path(download_path) page.set.download_path(download_path)
while True: def page_get(url):
time.sleep(1) host = domain.switch_domain(country)
title = page.title full_url = host + url
if title == "Amazon Sign-In": page.get(full_url, timeout=3)
print("请登录账号")
continue while True:
try: time.sleep(1)
page.ele("#cvf-submit-otp-button-announce") title = page.title
print("请输入验证码") if title == "Amazon Sign-In":
except ElementNotFoundError: print("请登录账号")
break continue
try:
page.ele("#cvf-submit-otp-button-announce")
print("请输入验证码")
except ElementNotFoundError:
break
def sku_relations(): def sku_relations():
......
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