python - 使用 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()
解决方案
推荐阅读
- c# - Serilog 在其输出中写入重复条目
- c - 在堆栈上声明内存会覆盖之前声明的内存
- android - 毕加索不在 MainActivity 中加载视图
- java - 为什么一个 Swing 击键有效,而另一个无效?
- php - 无法使用 CsvView 插件将数据保存到 csv 文件
- python - 如何修复“str”对象不可调用
- mongodb - 我想获取指定区域内的所有位置。但是在json中经纬度不是GeoJson格式
- scikit-learn - 通过替换 sklearn.cross_validation 从 sklearn.model_selection 导入 StratifiedShuffleSplit 时,参数应该发生什么变化
- python - Dropbox webhook 的 Flask 应用程序,通知不起作用
- reactjs - 如何在覆盖主题中为班级孩子应用样式?