Answer the question
In order to leave comments, you need to log in
How to scroll an element to the end?
There is the following code:
def scroll_to_down(self):
print("Скролим вниз")
lastHeight = self.driver.execute_script("return document.body.scrollHeight")
while True:
self.driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")
sleep(3)
newHeight = self.driver.execute_script("return document.body.scrollHeight")
if newHeight == lastHeight:
break
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