title: Scroll list selenium in python
body: <p>I write a small script and got a trouble. I try to scroll down the list but it doesn't work properly. Here is my code</p>
  
  <pre><code>    def get_followers(self):
              try:
                  self.driver.find_elements_by_css_selector('a._t98z6')[0].click()
              except Exception as e:
                  print("Sorry, i don't have access to your followers: {0}".format(e))
              else:
                  followers = []
                  while True:
                  self.driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")
                  try:
                      WebDriverWait(driver, 20).until(lambda x: x.find_element_by_css_selector('li._6e4x5')) #It doesn't find element.
                  except:
                      break
              followers = self.driver.find_elements_by_css_selector("a._2g7d5.notranslate._o5iw8")
  return followers
  </code></pre>
  
  <p>I also tried to use xpath like this:</p>
  
  <pre><code>WebDriverWait(driver, 20).until(lambda x: x.find_element_by_xpath("//li[@class = '_6e4x5']"))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/OVC4o.png" rel="nofollow noreferrer">Screen of the list</a>
  <a href="https://i.stack.imgur.com/yQV4x.png" rel="nofollow noreferrer">Screen of the html code</a></p>
  
  <p>I really need your help. Thanks a lot</p>