From deb366880e16eb79d9b219553e715f12199f1ba6 Mon Sep 17 00:00:00 2001 From: break27 Date: Fri, 25 Jul 2025 19:25:12 +0800 Subject: [PATCH] update: failed attempts markup --- 邮件批量发送脚本.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/邮件批量发送脚本.py b/邮件批量发送脚本.py index 0b3aa1c..95b3091 100644 --- a/邮件批量发送脚本.py +++ b/邮件批量发送脚本.py @@ -329,15 +329,16 @@ def main(): try: wait = WebDriverWait(driver, timeout=args.interval) alert = wait.until(lambda x: x.find_element(By.CSS_SELECTOR, "div.io-ox-alert.io-ox-alert-error")) - + + sents[current] = '❌' message = alert.text.replace('\n', ' ') - if not message: print(f'[警告] 程序异常。请保持页面在前台显示,避免遮挡或最小化') - else: print(f'[警告] ({attempt}): {message}') + if not message: raise Exception('程序异常。请保持页面在前台显示,避免遮挡或最小化') + print(f'[警告] ({attempt}): {message}') # 关闭警告 click("div.io-ox-alert.io-ox-alert-error button[data-action='close']") except TimeoutException: - sents[current] = '✔' + sents[current] = '✔️' occurrence[0] += 1 sent += 1 break