
Security News
Next.js Patches Critical Middleware Vulnerability (CVE-2025-29927)
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
puppeteer-infinite-scroller
Advanced tools
Provides a simple and efficient solution for scraping data loaded through infinite scrolling on web pages using Puppeteer.
Puppeteer-Infinite-Scroller provides a simple and efficient solution for scraping data loaded through infinite scrolling on web pages using Puppeteer.
You can install the package using npm:
npm install puppeteer-infinite-scroller
Import the puppeteerInfiniteScroller function from the package and use it to scrape data from infinite scrolling web pages.
const puppeteer = require("puppeteer");
const puppeteerInfiniteScroller = require('puppeteer-infinite-scroller');
(async () => {
const pageUrl = "https://infiniteajaxscroll.com/examples/blocks/";
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({
width: 1200,
height: 800,
});
await page.goto(pageUrl);
await page.waitForSelector(".blocks .blocks__block");
const options = {
scrollDelay: 1000, // Milliseconds between scrolls
itemCount: 50, // Number of items to scrape
selector: '.blocks .blocks__block', // CSS selector for items
// OR
// pageFunction: () => { /* Custom page function for scraping */ }
};
const scrapedData = await puppeteerInfiniteScroller(page, options);
console.log(scrapedData);
await browser.close();
})();
The following options can be configured when using the puppeteerInfiniteScroller
function:
scrollDelay
(optional): Milliseconds between scrolls. Default is 1000ms.itemCount
(optional): Number of items to scrape. Default is 10.selector
(optional): CSS selector for the items. Either this or pageFunction
must be provided.pageFunction
(optional): Custom function for scraping data from the page. Either this or selector
must be provided.const puppeteer = require("puppeteer");
const puppeteerInfiniteScroller = require('puppeteer-infinite-scroller');
(async () => {
const pageUrl = "https://infiniteajaxscroll.com/examples/blocks/";
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({
width: 1200,
height: 800,
});
await page.goto(pageUrl);
await page.waitForSelector(".blocks .blocks__block");
function extractElements() {
const items = [];
const extractedElements = document.querySelectorAll(".blocks .blocks__block");
for (let element of extractedElements) {
items.push({
class: element.getAttribute("class"),
id: element.getAttribute("id"),
tagName: element.tagName,
});
}
return items;
}
const options = {
scrollDelay: 1000, // Milliseconds between scrolls
itemCount: 50, // Number of items to scrape
pageFunction: extractElements
};
const scrapedData = await puppeteerInfiniteScroller(page, options);
console.log(scrapedData);
await browser.close();
})();
License This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Provides a simple and efficient solution for scraping data loaded through infinite scrolling on web pages using Puppeteer.
The npm package puppeteer-infinite-scroller receives a total of 1,803 weekly downloads. As such, puppeteer-infinite-scroller popularity was classified as popular.
We found that puppeteer-infinite-scroller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Next.js has patched a critical vulnerability (CVE-2025-29927) that allowed attackers to bypass middleware-based authorization checks in self-hosted apps.
Security News
A survey of 500 cybersecurity pros reveals high pay isn't enough—lack of growth and flexibility is driving attrition and risking organizational security.
Product
Socket, the leader in open source security, is now available on Google Cloud Marketplace for simplified procurement and enhanced protection against supply chain attacks.