title: How should you scroll down a page using selenium?
body: <p>I`m trying to create a webscraper and some of the contents I want to scrape are changing only when I scroll down the &quot;Products Scroll Bar&quot; . I tried accessing it using xpath and class name after waiting for the element to load but with no succes. Here is the code I wrote:</p>
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.by import By
  from selenium.webdriver.common.keys import Keys
  from selenium.webdriver.chrome.webdriver import WebDriver
  from selenium.webdriver.support.ui import WebDriverWait
  from selenium.webdriver.support import expected_conditions as EC
  
  PATH = 'C:\Program Files (x86)\chromedriver.exe'  #v.96
  
  driver = webdriver.Chrome(PATH)
  product_page=&quot;https://www.infineon.com/cms/en/product/power/mosfet/?filterValues=~(packageName~(~%27DPAK))&amp;visibleColumnIds=name,productStatusInfo,orderOnline,opn,551,packageName,packageNameMarketing,473_max,559_93_max,559_93_nom,559_90_max,451_154_max,547_136_nom,547_136_max,547_135_nom,830,529,284_min,284_max,478_min,478_max,478_nom,618#!products&quot;
  
  driver.maximize_window()
  driver.implicitly_wait(5)
  driver.get(product_page)
  
  driver.find_element_by_xpath('//*[@id=&quot;cookie-modal&quot;]/div/div/div[3]/div/form/div[2]/button').click()
  
  try:
      element = WebDriverWait(driver, 10).until(
          EC.presence_of_element_located((By.CLASS_NAME, 'ScrollbarLayout_face ScrollbarLayout_faceVertical public_Scrollbar_face'))
      )
      
      element.send_keys(Keys.END)
  except:
      driver.quit()
      
  
  </code></pre>
  <p>The bar I need to scroll down :
  <a href="https://i.stack.imgur.com/jXloW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jXloW.png" alt="enter image description here" /></a></p>
  <p>Any advice on how I should approach the problem or why it dosen`t work?</p>