while True:
    driver.execute_script('window.scrollTo(0, document.body.scrollHeight);')
time.sleep(pause)
newHeight = driver.execute_script('return document.body.scrollHeight')
if newHeight == lastHeight:
    break
lastHeight = newHeight
Scroll down to bottom of infinite page with PhantomJS in Python