xpath - 无法在“应用”按钮下找到 Linkedlin 网站的元素
问题描述
我为LinkedIn的以下步骤创建了自己的自定义xpath:
- www.linkedin.com - 启动 URL
- 登入
- 查看资料
- 点击职位
- 输入 QA Lead
- 点击发布日期
- 24小时内选择
- 单击应用 <----- 在这里我无法单击此按钮。
Xpath: driver.findElement(By.xpath("button[@class='facet-collection-list__cancel-button mr2 artdeco-button artdeco-button--静音 artdeco-button--2 artdeco-button--tertiary ember-view' ]//span[text()='Cancel']/parent::button/following-sibling::button//span[@class='artdeco-button__text']")).click();
解决方案
我能够弄清楚。我相应地修改了xpath并且它起作用了:
driver.findElement(By.xpath("//*[@data-control-name='filter_pill_cancel' and @class='facet-collection-list__cancel-button mr2 artdeco-button artdeco-button--静音 artdeco-button-- 2 artdeco-button--tertiary ember-view']//span[@class='artdeco-button__text' and text()='Cancel']/parent::button/following-sibling::button//span[text ()='应用']")).click();
推荐阅读
- javascript - 行的HTML CSS表格边框颜色问题
- c++ - C++ 错误 LNK1104 无法打开文件 'system.dll' - 当我不尝试打开它时
- node.js - 预期 Iterable,但没有找到字段 \"Query.customers\
- php - 禁用特定日期
- ios - 展开唯一点击的单元格并折叠其他单元格
- javascript - Moment js在后天不显示错误消息
- java - 用于物联网集线器设备固件更新的 Rest api
- javascript - 表格添加行、编辑行、保存行、删除行使用HTML、CSS、JS
- java - 在运行时错误在 ARCore 数据库中添加图像
- apache - 无法从另一台计算机访问 apache2 虚拟主机