update: save instead of deleting drafts
This commit is contained in:
@@ -362,13 +362,11 @@ def main(driver: WebDriver):
|
|||||||
|
|
||||||
while mails := driver.find_elements(By.CSS_SELECTOR, "div.io-ox-mail-compose-window"):
|
while mails := driver.find_elements(By.CSS_SELECTOR, "div.io-ox-mail-compose-window"):
|
||||||
try:
|
try:
|
||||||
# 关闭过期邮件
|
|
||||||
click("button[data-action='close']", parent=mails[0])
|
click("button[data-action='close']", parent=mails[0])
|
||||||
# 删除过期邮件
|
click("div.modal-footer button[data-action='savedraft']")
|
||||||
click("div.modal-footer button[data-action='delete']")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"[警告] 关闭邮件时发生了错误:{e}")
|
print(f"[警告] 关闭邮件时发生了错误:{e}")
|
||||||
continue
|
break
|
||||||
|
|
||||||
if attempt < args.retry:
|
if attempt < args.retry:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user