How do I scroll a little bit less than scrolling all the way to the bottom the whole time? Instead of scrolling all the way to the bottom, I want to scroll maybe 50% of it to grab more content. Since beautiful soup is not grabbing everything I need. Here's the code I'm using for scrolling down on pinterest.
while True:
#Scroll down to bottom
browser.execute_script("window.scrollTo(0, document.body.scrollHeight);")
#Wait to load page
time.sleep(scroll_pause)
#Calculate new scroll height and compare with last scroll height
new_height = browser.execute_script("return document.body.scrollHeight")
if new_height == last_height:
break
last_height = new_height
I will appreciate any advice or help.