https://github.com/andrelmlins/puppeteer-extra-plugin-auto-scroll
A auto scroll plugin for puppeteer-extra
https://github.com/andrelmlins/puppeteer-extra-plugin-auto-scroll
auto-scroll infinite-scroll puppeteer puppeteer-extra puppeteer-extra-plugin
Last synced: 3 months ago
JSON representation
A auto scroll plugin for puppeteer-extra
- Host: GitHub
- URL: https://github.com/andrelmlins/puppeteer-extra-plugin-auto-scroll
- Owner: andrelmlins
- License: mit
- Created: 2020-04-01T17:59:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T15:20:09.000Z (about 1 year ago)
- Last Synced: 2025-04-12T23:54:00.692Z (3 months ago)
- Topics: auto-scroll, infinite-scroll, puppeteer, puppeteer-extra, puppeteer-extra-plugin
- Language: JavaScript
- Homepage:
- Size: 60.5 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# puppeteer-extra-plugin-auto-scroll
> A plugin for [puppeteer-extra](https://github.com/berstend/puppeteer-extra) to auto scroll.
[](https://www.npmjs.com/package/puppeteer-extra-plugin-auto-scroll) [](https://github.com/andrelmlins/puppeteer-extra-plugin-auto-scroll/blob/master/LICENSE) [](https://travis-ci.com/andrelmlins/puppeteer-extra-plugin-auto-scroll)
## Install
```sh
npm install puppeteer-extra-plugin-auto-scroll
# or
yarn add puppeteer-extra-plugin-auto-scroll
```If this is your first [puppeteer-extra](https://github.com/berstend/puppeteer-extra) plugin here's everything you need:
```sh
yarn add puppeteer puppeteer-extra puppeteer-extra-plugin-auto-scroll
# or
npm install puppeteer puppeteer-extra puppeteer-extra-plugin-auto-scroll
```## Usage
```js
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
[](https://nodei.co/npm/puppeteer-extra-plugin-auto-scroll/)
## License
`puppeteer-extra-plugin-auto-scroll` is open source software [licensed as MIT](https://github.com/andrelmlins/puppeteer-extra-plugin-auto-scroll/blob/master/LICENSE).