📜  使用节点和 puppeteer 滚动页面 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:29.787000             🧑  作者: Mango

代码示例1
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);