Home > Software design >  find clickable xpath on a webpage
find clickable xpath on a webpage

Time:06-15

on below NSE site, I need to click the Download (.csv) button through selenium and I am using below code but its not working-

Site: enter image description here

CodePudding user response:

First of all find_elements_by_xpath returns you a list, what you would need is browser.find_element_by_xpath("//*[@id="downloadOCTable"]").

Store the returned object instance in a variable say element_click. Then call click on it as

element_click.click()

This should work, or alternatively you can try

link = driver.find_elements_by_xpath('//*[@id="downloadOCTable"]')
link[0].click()
  • Related