Scroll (Scroll Screen) with Selenium in Python: Error

Asked

Viewed 1,460 times

1

I have a list of items on the screen, in which I need to click one by one to parse data. It turns out that at some point, Selenium can’t click anymore, because when it tries, the following error happens:

selenium.common.exceptions.WebDriverException: Message: unknown error: Element is not clickable at point

I’m trying to get the screen to scroll gradually with each iteration, but I’m not succeeding. When I run the line below

browser.execute_script('window.scroll(0, 200)')

The screen scrolls, to then present the error

selenium.common.exceptions.WebDriverException: Message: unknown error: call function result missing 'value'

Then any new scrolling attempt is ignored. Any hint of how to proceed to outline the situation?

  • I’m realizing that it rolls the screen to a certain position. How would I roll the screen X times??? Surely this is the problem.

1 answer

1

Discovered another one (scrollBy):

try:
    browser.execute_script('window.scrollBy(0, 15)')
except:
    None

I did it this way to get around the error, which I still don’t understand why it occurs. But it was enough to get around the problem.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.