update: iframe interactability check

This commit is contained in:
2025-07-22 15:58:04 +08:00
parent 655ceea5b5
commit 80dce977d3

View File

@@ -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()