Skip to content
Advertisement

Scroll in Selenium Webdriver (Python)

Prerequisites.
You need an account at Instagram to use this script.
Setup a test environment:

Log in, open the needed list(works correctly):

JavaScript

Wrong scroll. How to fix this block?

How to focus and scroll correctly on this page?

My attempts:

JavaScript

=============================================================
to @Moshisho :

We need to focus on some element to activate it.
The question is what the element we need to choose to focus and how?
This is not a “body”:
something like that, but not this:

JavaScript

Without it this command do not work.


to @Naveen :

JavaScript

And what’s next?

JavaScript

https://www.instagram.com/youtube/following/

Advertisement

Answer

Try the following code:

JavaScript

Observed that browser is sending AJAX request to load more users. this action is triggered when you scroll using mouse or enter Space or End keys

Advertisement