Why Can't Selenium Scroll Down Page

Viewed 22

Bear with me, im fairly new to everything (this is not a homework question). I have been trying to get selenium to infinitely scroll down a page. My script works with every website I try it on except for under the discovery tag in Gumroad. Im not sure why its not working and I've tried everything that comes to mind along with seemingly everything google has to offer.

Any Help is appreciated!

-This issue only happens under the discovery section after searching

from selenium.webdriver.common.by import By

website = (r'https://discover.gumroad.com/?query=3d')
driver = webdriver.Chrome('C:\Program Files (x86)\chromedriver.exe')
driver.get(website)


driver.execute_script("window.scrollTo(0, 5000)") 

Gumroad page

1 Answers

Seems more like a problem with this page then with selenium. A workaround you can use - if you want - is to select one element and use Keys.END

from selenium.webdriver.common.keys import Keys
elem = driver.find_element(By.TAG_NAME, "html")
elem.send_keys(Keys.END)
Related