while True:
    self.driver.execute_script(
        'window.scrollTo(0, document.body.scrollHeight);')
current = len(WebDriverWait(self.driver, 30).until(EC.
    presence_of_all_elements_located((By.CLASS_NAME, 'x'))))
if current == prior:
    return current
prior = current
Прокрутка страницы вниз с помощью Selenium Webdriver