c# - 未单击按钮(硒 c#)
问题描述
只是尝试下面的代码点击导出按钮,它没有点击按钮
driver.FindElement(By.XPath("//span[@class='ui-button-text' and contains(.,'Export')]")).Click();
外部 HTML 代码
出口
<span class="ui-button-text" style="">Export</span>
解决方案
利用
driver.FindElement(By.XPath("//span[@class='ui-button-text' and contains(.,'Export')]")).click();
(小写click()
)。
推荐阅读
- php - 逐行读取.gz文件
- scala - ScalaTest 断言集合包含一个类型
- javascript - 如何为表格单元格的内部 html 创建 OnClick 事件
- rest - Google Calendar REST API 不返回标题和其他事件字段
- web-scraping - 仅将 IMAGE 函数添加到通过 IMPORTXML 收集的一列数据中
- javascript - JS:将页面动画保存到 mp4
- python - Python中有没有一种方法可以在线性回归分析中获取分布残差?
- php - Wordpress 登录重定向影响管理对话框
- javascript - 类型错误:res.response 未定义
- mongodb - MongoDB Compass:选择不同的字段值