Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-09T23:28:36.000Z (about 2 years ago)
- Last Synced: 2024-06-11T18:06:08.638Z (8 months ago)
- Topics: auto-scroll, infinite-scroll, puppeteer, puppeteer-extra, puppeteer-extra-plugin
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
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.
[![npm version](https://badge.fury.io/js/puppeteer-extra-plugin-auto-scroll.svg)](https://www.npmjs.com/package/puppeteer-extra-plugin-auto-scroll) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/andrelmlins/puppeteer-extra-plugin-auto-scroll/blob/master/LICENSE) [![Build Status](https://travis-ci.com/andrelmlins/puppeteer-extra-plugin-auto-scroll.svg?branch=master)](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
[![NPM](https://nodei.co/npm/puppeteer-extra-plugin-auto-scroll.png)](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).