Answer the question
In order to leave comments, you need to log in
Why is scrolling stuck in a div block?
Using Selenium, I'm trying to scroll a div block with Instagram community followers to the very end (there are more than 4 thousand posts), but at 2432 people the scrolling freezes, the next batch of users starts loading endlessly. Tried through Chrome and Firefox, tried installing different versions of webdriver, but it didn't help. I write in Python.
Scrolling is done using these two lines in a loop:
scr1 = browser.find_element_by_xpath('html/body/div/div[@role="dialog"]/div[2]')
browser.execute_script("arguments[0].scrollTop = arguments[0].scrollHeight", scr1)
I also tried to keep the div from being cluttered with too many users, remove the top entries (li tags) and scroll further, but it didn't help. It is worth saying that scrolling sometimes freezes earlier, but usually on user 2432. It won't be able to load further.
I don't think it's a Selenium issue, as I've tried manually scrolling through this freeze stage, but it still freezes.
Perhaps this is an Instagram limitation?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question