I'm trying to scroll to the bottom of popup page on Stockx to gather all the recent sale prices for an item. But I can't seem to get to the bottom of the popup to click the load more button. This is what I have so far. Help pls.
import bs4
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium import webdriver
import time
from selenium.webdriver.common.keys import Keys
PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)
driver.get("https://stockx.com/supreme-patchwork-mohair-cardigan-multicolor")
time.sleep(3)
driver.find_element_by_xpath('//*[@id="root"]/div[1]/div[2]/div[2]/div[9]/div/div/div/div[2]/div/div[2]/div/div/button').click()
driver.find_element_by_xpath('//*[@id="root"]/div[1]/div[2]/div[2]/div[9]/div/div/div/div[2]/div/div[1]/div[2]/a').click()
time.sleep(3)
element_in_popup = driver.find_element_by_xpath('/html/body/div[9]/div/div/div/div[2]/div')
while EC.presence_of_element_located((By.XPATH,'/html/body/div[9]/div/div/div/div[2]/div/button')):
element_in_popup.send_keys(Keys.END) # Use send_keys(Keys.HOME) to scroll up to the top of page
driver.find_element_by_xpath('/html/body/div[9]/div/div/div/div[2]/div/button').click()