Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

scrolling a page using node and puppeteer

const distance = 100;
const delay = 100;
const timer = setInterval(() => {
  document.scrollingElement.scrollBy(0, distance);
  if (document.scrollingElement.scrollTop + window.innerHeight >= document.scrollingElement.scrollHeight) {
    clearInterval(timer);
  }
}, delay);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #scrolling #page #node #puppeteer
ADD COMMENT
Topic
Name
4+5 =