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

Selenium Python, element not clickable because obscured

$
0
0

I am trying to webscrape multiple pages from a website, but to get to the next page I have to click the 'Next' button.

I programmed my code on my computer, where it runs perfectly. Now I have tried to run it on my laptop and it wasn't able to click on the button. So from just finding the element and then clicking on it, I have added a WebDriverWait to wait till the button is loaded and then click on it. Now I have the problem that the button is obscured and I do not know how to solve this issue.

This is my code:

xPath = (By.XPATH,
        '''//div[contains(@class, "prodListnav active")][contains(@onclick, 'prodListPage("next")')]''')
nextbutton = WebDriverWait(self.browser, 60).until(EC.element_to_be_clickable(xPath))
nextbutton.click()

The error:

selenium.common.exceptions.ElementClickInterceptedException: Message: Element <div class="prodListnav active"> is not clickable at point (774,679) because another element <div class="text"> obscures it

And the HTML is this:

<main>
    <div class="navigation">
        <div id="navigation_products" style="display:block; box-sizing:border-box; position:relative;">
            <div class="prodListnav active" onclick="prodListPage("next")"><img class="nav" src="/templates/basic/images/right-icon.png" alt="page right"></div></div>

The website I am trying to scrape is: https://www.megekko.nl/Computer/Componenten/Videokaarten


Viewing all articles
Browse latest Browse all 97756

Trending Articles



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