diff --git a/邮件批量发送脚本.py b/邮件批量发送脚本.py index a53535a..4027df6 100644 --- a/邮件批量发送脚本.py +++ b/邮件批量发送脚本.py @@ -197,9 +197,6 @@ def main(): wait = WebDriverWait(driver, timeout=args.timeout) wait.until_not(lambda x: x.find_element(By.CSS_SELECTOR, ".io-ox-busy")) - # 点击活动窗口 - click("div.io-ox-mail-compose-window div.floating-header") - # 填入收件人 wrapper = locate("div.io-ox-mail-compose-window div[data-extension-id='to'] > div.mail-input") to = locate("input.token-input.tt-input[tabindex='0']", parent=wrapper) @@ -233,12 +230,15 @@ def main(): # 删除过期邮件 click("div.modal-footer button[data-action='delete']") break + except KeyboardInterrupt: + print('[信息] 程序中断') except Exception as e: print(f'[警告] 发生错误:{e}') - key = input('[????] 重试 (R) / 跳过 (S) / 取消 (C): ') - if key in ['R', 'r']: continue - elif key in ['S', 's']: break - else: active = False + + key = input('[????] 重试 (R) / 跳过 (S) / 取消 (C): ') + if key in ['R', 'r']: continue + elif key in ['S', 's']: break + else: active = False if input('[????] 是否保存到文件?确定 (Y) / 取消 (N): ') in ['Y', 'y']: print(f'[信息] 正在写入文件:{args.input}')