So the issue is very simple and straightforward. In the link https://www.nasdaq.com/symbol/iff/revenue-eps
I want to click the link "Previous 3 Years" using selenium, but it just doesnt seem to work.
The code below is what I attempted. It worked for most webpages, but not for this for some reason. I tried to find the element by the text it holds and click it.
link = driver.find_element_by_link_text('Previous 3 Years')
link.click()
And when I did eventually run it, this is the error message I receive:
Traceback (most recent call last):
File "writeTest.py", line 68, in <module>
link = driver.find_element_by_link_text('Previous 3 Years')
File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 428, in find_element_by_link_text
return self.find_element(by=By.LINK_TEXT, value=link_text)
File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\hp\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"link text","selector":"Previous 3 Years"}
(Session info: headless chrome=76.0.3809.100)
Can anyone please tell me what seems to be the issue here?