python - 如何单击带有 python selenium 的链接
问题描述
我正在尝试使用 click() 单击此链接:
<a id="export-button" class="pull-right" @click="exportFile('/en/my-investments/list.xlsx')">
<i class="fa fa-file-excel-o"></i> Download Selected List
</a>
但它说该元素不可点击......有什么想法吗?
解决方案
您可以使用动作类来单击您的元素,
from selenium.webdriver import ActionChains
actions = ActionChains(driver)
actions.move_to_element(driver.find_element_by_xpath("//a[@id='export-button']")).click().perform()
推荐阅读
- hadoop - 在 GCP 中查找 jar 文件的路径
- javascript - 响应未从 axios 呈现响应获取请求
- python - 如何清理熊猫数据框列中的文本数据
- python - Scala 的密封在 python 中
- javascript - 无法获得单一类别 - NodeJs API
- javascript - 表为空时,Flask Modal 不起作用
- angular - 在Angular 2+中嵌入模态的对话框前面显示mat-select
- tensorflow - 运行 object_detection_tutorial TypeError 的问题:load() 缺少 2 个必需的位置参数
- linux - 工作时sqlmap语法不问任何问题
- python - 查找不包含任何字符 ( . - \ / ) 的列表元素