title: How to scroll to the end of the page using selenium in Python?
body: <p>I am trying to scroll to the end of a page so that I can make all the data visible and extract it. I tried to find a command for it but it's available in java (driver.executeScript) but couldn't find for python. Right now I am making the computer press the end key thousand times:</p>
  
  <pre><code>while i&lt;1000:
      scroll = driver.find_element_by_tag_name('body').send_keys(Keys.END)
      i+=1
  </code></pre>
  
  <p>And I also tried <code>driver.execute_script("window.scrollTo(0, document.body.scrollHeight);")</code> but it scrolls to the end of the loaded page and the same thing END key does. Once at the bottom of the page, next content loads. But now it doesn't scroll again.</p>
  
  <p>I know there will be a very nice alternative for this.</p>
  
  <p>How do I scroll to the end of the page using selenium in Python?</p>