pad

puppeteer-autoscroll-down

Handle infinite scroll on websites by puppeteer

Showing:

Popularity

Downloads/wk

2.3K

GitHub Stars

26

Maintenance

Last Commit

4mos ago

Contributors

2

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Handle infinite scroll on websites by puppeteer

We use window.scrollBy method for scrolling pages.

Usage

const browser = await puppeteer.launch()
const page = await browser.newPage()
await page.goto(SOME_URL)

const lastPosition = await scrollPageToBottom(page)

await browser.close()

You can use returned value with request/response hooks to handle async content uploading.

Scrolling options

scrollStep - Number of pixels to scroll on each step.

scrollDelay - A delay between each scroll step in ms.

const scrollStep = 250 // default
const scrollDelay = 100 // default
const lastPosition = await scrollPageToBottom(page, scrollStep, scrollDelay)

Install

npm i puppeteer-autoscroll-down

or

yarn add puppeteer-autoscroll-down

Contributing

Feel free to ask or open an issue.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100