puppeteer-extra-plugin-auto-scroll

0.2.2 • Public • Published

puppeteer-extra-plugin-auto-scroll

A plugin for puppeteer-extra to auto scroll.

npm version License: MIT Build Status

Install

npm install puppeteer-extra-plugin-auto-scroll
# or 
yarn add puppeteer-extra-plugin-auto-scroll

If this is your first puppeteer-extra plugin here's everything you need:

yarn add puppeteer puppeteer-extra puppeteer-extra-plugin-auto-scroll
# or 
npm install puppeteer puppeteer-extra puppeteer-extra-plugin-auto-scroll

Usage

const puppeteer = require('puppeteer-extra');
const autoScrollPlugin = require('puppeteer-extra-plugin-auto-scroll');
 
puppeteer.use(autoScrollPlugin());
 
async function getPage(url) {
  const browser = await puppeteer.launch({ headless: false });
  const page = await browser.newPage();
  await page.goto(url);
  await page.autoScroll();
 
  let content = await page.content();
  await browser.close();
  return content;
}

Params

Parameters of the autoScroll function in order:

selector

Type String Default: body Required: false

distance

Type Number Default: 100 Required: false

timeout

Type String Default: 1000 Required: false

NPM Statistics

Download stats for this NPM package

NPM

License

puppeteer-extra-plugin-auto-scroll is open source software licensed as MIT.

Package Sidebar

Install

npm i puppeteer-extra-plugin-auto-scroll

Weekly Downloads

5

Version

0.2.2

License

MIT

Unpacked Size

5.38 kB

Total Files

4

Last publish

Collaborators

  • andrelmlins