Hope any of you already encountered this issue (or not if im just doing something wrong).
I have this code which should srcroll down until all the items has been loaded, however it does not seem to scroll.
# Get scroll height
last_height = self.driver.execute_script("return document.body.scrollHeight")
print('Done getting height', last_height);
while True:
# Scroll down to bottom
self.driver.execute_script("window.scrollTo(0, document.body.scrollHeight)"; )
# Wait to load page
sleep(5)
# Calculate new scroll height and compare with last scroll height
new_height = self.driver.execute_script("return document.body.scrollHeight")
print(new_height)
if new_height == last_height:
sleep(2)
break
last_height = new_height
I'm using Py v3.7 and the latest selenium version as of posting, no other dependency used.
Here is a screenshot of page, unfortunately i cannot share it since it has confidential information, i tried to check somethings on the page and I found out that if i click on a certain part of the page it does not let you scroll, maybe because this is a page from a sharepoint site?
I tried using the same code on duckduckgo website and it works fine, and I clicked on any of the duckduckgo website and it is scrollable too, seems like my hunch is correct?