1.2 KiB
1.2 KiB
English · Dansk · Bahasa Malaysia
Step 4 - Find the followers
find_followers() opens the page of the target account at /u/<account> and clicks the followers link. The list in the modal loads about a dozen followers at first, so we scroll to load the rest.
The modal is not the scrolling element. The scrollable part is the inner followers-scroll element, so the script scrolls that element: arguments[0].scrollTop = arguments[0].scrollHeight.
What we gained
- Running JavaScript from Selenium with
execute_script. - Finding the element that really scrolls by inspecting the page, instead of scrolling the whole window.
- Pausing between scrolls so the page can load more entries.


