title: Selenium Python: How to scroll a div
body: <p>I need to flip through a number of pages of a list on the left side of the page <a href="https://2gis.ru/moscow/search/%D0%BF%D0%B0%D1%80%D0%BA%D0%BE%D0%B2%D0%BA%D0%B0%20/tab/geo?queryState=center%2F37.644653%2C55.827805%2Fzoom%2F12" rel="nofollow noreferrer">here</a>. To do that firstly I need to scroll down a specific div section and then to click on the <code>next</code> button. But the scrolling works perfect in one case (<code>url_ok</code>) and doesn't work in another (<code>url_trouble</code>). Don't have any ideas why.
  The code I'm testing:</p>
  
  <pre><code>from selenium import webdriver
  import time
  driverPath = "C:/Program Files (x86)/Google/Chrome/Application/chromedriver.exe"
  driver = webdriver.Chrome(driverPath)   
  
  url_trouble = 'https://2gis.ru/moscow/search/%D0%BF%D0%B0%D1%80%D0%BA%D0%BE%D0%B2%D0%BA%D0%B0%20/tab/geo?queryState=center%2F37.644653%2C55.827709%2Fzoom%2F12'   
  
  url_ok = 'https://2gis.ru/moscow/search/%D0%BF%D0%B0%D1%80%D0%BA%D0%BE%D0%B2%D0%BA%D0%B0%20/tab/firms?queryState=center%2F37.644653%2C55.827805%2Fzoom%2F12'
  
  
  def click(url, driver):
      driver.get(url)
      driver.maximize_window()
      time.sleep(5)
      next_link_data = driver.find_element_by_css_selector("div.pagination__arrow._right")
      next_link_data.location_once_scrolled_into_view
      next_link_data.click()
  
  click(url_trouble, driver) # it doesn't work
  click(url_ok, driver) # it works
  </code></pre>
  
  <p>So the question is how to scroll the <code>url_trouble</code> to the bottom?</p>
  
  <p>Thanks a lot for advance!</p>