diff --git a/邮件批量发送脚本.py b/邮件批量发送脚本.py index a5538bf..20bf80a 100644 --- a/邮件批量发送脚本.py +++ b/邮件批量发送脚本.py @@ -232,8 +232,10 @@ def main(): # 填入客户称呼 parts = name.split() firstname = parts[0] if len(parts) == 1 or (len(parts[0]) > 3 and '.' not in parts[0]) else " ".join([parts[0], parts[1]]) + + iframe = locate("div.io-ox-mail-compose-window iframe", condition=EC.element_to_be_clickable) action = ActionChains(driver).send_keys(Keys.END) - for attempt in range(len(firstname)): action.perform() + for attempt in range(args.retry): action.perform() ActionChains(driver, 5000).key_down(Keys.SHIFT).send_keys(Keys.LEFT).key_up(Keys.SHIFT).key_down(Keys.CONTROL).send_keys('x').key_up(Keys.CONTROL).perform() ActionChains(driver, 5000).send_keys(Keys.SPACE).send_keys(firstname).key_down(Keys.CONTROL).send_keys('v').key_up(Keys.CONTROL).perform()