2

I am trying to scroll a web page by using mouse and scroll bar. I am exploring any other option than

"driver.execute_script("window.scrollBy(0, 5000'))"

I did try options like chrome actions, however nothing seems to be working. Would need some guidance if anyone has any idea how to solve this.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

1

If your usecase is to scroll() the window containing the DOM document, there is no better way other then using the either of the following Window Methods:

If your usecase is to scroll() an Element there is no better way other then using the Element Method:

You can find a detailed discussion in What is the difference between the different scroll options?


However, if you want to avoid the execute_script() to interact with a WebElement you have two (2) other options available as follows:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    I had tried ActionChains but it is not giving me desired results. I was trying to scrape an intranet powerbi dashboard which has different sections all in iframe which can be scrolled. But thanks for your excellent answer. – Subhankor Sekhar Apr 25 '19 at 00:09