Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98800

Python Selenium; how do I click on an anchor element? [duplicate]

$
0
0

I am trying to click on an element that will download an Excel report. I am correctly locating the element using the below code. However, I am unable to click it by using .click or Select().

driver.find_element_by_xpath(element)

-.click returns "selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable"

-Select() returns "selenium.common.exceptions.UnexpectedTagNameException: Message: Select only works on elements, not on "

How do I click on the element? The element looks like this when I inspect it:

<a href="#" onclick="tablesToExcel(['summary','table1'], ['Report Profit'], 'myfile.xls')">
  <img src="/portalDispensary/vendors/tableExport/icon/xls.png" width="24px" class="mrx">
  "Export to Excel"</a>

Viewing all articles
Browse latest Browse all 98800


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>