python - Selenium,Python - 试图点击 react-text 标签或点击它所属的类的第 n 次出现会导致错误“找不到元素”
问题描述
我试过了
driver.find_element_by_xpath('//span[@style="Text_in_style"]')
但没有这样的元素给出错误。我知道我想要的“list-group-item report-item”位置是 20 个中的第 13 个,所以我可以以某种方式获得第 13 个类名称“list-group-item report-item”吗?谢谢!
解决方案
buttons = driver.find_elements_by_xpath('//*[@class="list-group report-group-list"]')
buttons[3].click()
谢谢!谷歌
推荐阅读
- oracle - 需要了解oracle中的查询
- python - 将无法存储在 GitHub 上的大文件包含在 python 包中的最佳方法
- c++ - LibUSB C++ USB 传输格式不同
- node.js - 如何创建在 MongoDB 中插入新记录后自动递增的字段?
- bash - 语法错误:单词意外(期待“fi”)
- python - Modbus python 脚本
- jquery - 基于数据属性而不是类查找元素。- 导轨
- java - 为什么 jpa 不创建表?
- r - 如何不在 R 中按字母顺序进行 dplyr::summarize
- python - 为所有简单的 pip 安装包授予 sudo 权限