Skip to content
Advertisement

Scroll to the bottom of a web page on a element in selenium

How do you scroll on a scrolling element in Python Selenium? (not the page itself but some element where you can scroll)

For example, go here: here

Then hit enter a lot of times in the “answer” text box. You can see that it creates a scroll bar on the text box only. How do I scroll through that in Selenium?

Advertisement

Answer

Just find the locator for that scroll bar using inspect element and then do scrolling on that

document.querySelector('textarea#wmd-input').scrollBy(0,500)
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement