from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
driver.get('https://twitter.com/BarackObama')
while True:
    driver.execute_script('window.scrollTo(0, document.body.scrollHeight);')
time.sleep(3)
Scrolling down a page with Selenium Webdriver