首页 > 解决方案 > 使用 selenium webdriver 在 Outlook Office 上找到一个按钮

问题描述

我需要一些帮助来找到单击office365侧面菜单中的“新建组”后出现的“创建”按钮(该按钮具有动态ID)

newgrpbutton=driver.find_element(By.XPATH, "//div[@title='New group']")
time.sleep(10)
newgrpbutton.click()
time.sleep(15)
actions=ActionChains(driver)
actions.send_keys("tstgrp1")
actions.perform()
time.sleep(20)
#it shows me an error here, Ive tried xpath too but nothing
createbutton=driver.find_elements(By.CSS_SELECTOR,".ms-Button--primary")
time.sleep(8)
actions.double_click(createbutton)
actions.perform()
time.sleep(10)
ntnow=driver.find_elements(By.CSS_SELECTOR,".ms-Button--default")
time.sleep(2)
actions.click_and_hold(ntnow)
actions.perform()

标签: pythonseleniumselenium-chromedriver

解决方案


推荐阅读