Issue
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: https://www.nseindia.com/option-chain
Code:
link = driver.find_elements_by_xpath('//*[@id="downloadOCTable"]')
link.click
Solution
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()
Answered By - Himanshu Poddar
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.