I'm trying to click links on a website, there's a full page of them. I tried using the is_displayed() option, I came back "true" but then still gave me this error. I've encountered this error before on other projects, its because selenium doesn't see the link. I tried putting a scroll down option in the code but that only works so many times as the page down ends up scrolling too far.
What other options do I have to get the link visible to click on?
Code:
href1 = driver.find_element_by_xpath("//*[@id='divDesktopResults']//div//div//div//a[@href='" + link + "']")
if (href1.is_displayed()):
print('true')
href1.click()
else:
print('False')
Error:
selenium.common.exceptions.WebDriverException: Message: unknown error: Element <a class="popimg" data-toggle="popover" style="text-decoration:underline;margin-right:20px;" data-content="<img style='max-width:250px;' src='/Home/GetPng?ID=D218098469' ></a>" data-html="true" data-trigger="hover" href="#pdfviewer?ID=D218098469">...</a> is not clickable at point (441, 514). Other element would receive the click: <div class="row">...</div>
(Session info: chrome=66.0.3359.181)
(Driver info: chromedriver=2.38.552522 (437e6fbedfa8762dec75e2c5b3ddb86763dc9dcb),platform=Windows NT 10.0.16299 x86_64)
Edit:
Solved another way, put all the links in an array and used driver.get instead of clicking the link.