【问题标题】:How to click on a link with python selenium如何单击带有 python selenium 的链接
【发布时间】:2018-08-09 14:08:25
【问题描述】:

我正在尝试使用 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>

但它说该元素不可点击...有什么想法吗?

【问题讨论】:

标签: python selenium-webdriver


【解决方案1】:

你可以使用动作类来点击你的元素,

from selenium.webdriver import ActionChains

actions = ActionChains(driver)
actions.move_to_element(driver.find_element_by_xpath("//a[@id='export-button']")).click().perform()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-02-21
    • 2019-05-23
    • 2015-03-08
    • 2021-12-03
    • 1970-01-01
    相关资源
    最近更新 更多