Use a bounded scroll-and-observe loop: after each scroll, wait for a page-specific signal—such as a larger item count—to change. Stop only after that signal stays unchanged for several rounds, then call page.screenshot(). Puppeteer has no universal event that means an infinite feed is finished, so the selector, scroll target, and stability window must match the site.
Choose a signal that means the feed has changed
Puppeteer’s Page.waitForFunction() waits until a function evaluated in the page returns a truthy value. It is a general condition-waiting tool, not an infinite-scroll detector; the feed itself determines what counts as completion. The documented default timeout is 30 seconds.
As an Amazon Associate I earn from qualifying purchases.
For an append-only feed, the number of matching items is a convenient signal. Other pages may expose a loading indicator, an end-of-feed marker, or stable IDs for the newest item. A count alone can be misleading when a feed replaces or recycles DOM nodes, as virtualized feeds often do. Inspect the target page and choose a signal that reflects new content rather than merely a changed layout.
Find the right scroll target
Some feeds load on viewport scrolling; others scroll within a particular container. Identify which element actually moves and triggers loading. Puppeteer’s page-interactions guide documents Locator.scroll() for scrolling an element and recommends Locators for actions that wait for element state and a stable bounding box.
#1 Best Overall
- [INTEL POWERED CONTENT] - Built with a 8th Generation Hexa-Core Intel i5 and 32GB of DDR4 RAM; Modern, Windows 11 ready, with 4K support, Executive multitasking, media streaming and smooth, multi-tab web browsing; Perfect as an all-purpose multimedia computer; built for content creators; Plenty of RAM and Mass storage for photo and video editing powered by Intel HD 630
- [LATEST WIRELESS TECH] - This Dell Desktop Computer easily connects to the internet through the Built In WiFi / Bluetooth
- [SOLID STATE STORAGE] - This Dell Computer setup comes with an ultra-fast 1TB Solid State Drive (SSD); Setup as the primary boot device; Boot and load programs with lightning speed ; Additional expansion available
- [BUY & OWN WITH CONFIDENCE] - From the world's largest Microsoft Authorized Refurbisher; Quality Guarantee and Free Tech Support; Award-winning Customer Service; | Support Sustainable Business
- [MODERN HI-SPEED PORTS] - USB 3.0 (x4) | USB 2.0 (x4) | DisplayPort (x1) | HDMI Port (x1) | Audio Combo Jack (x1) | Audio Out (x1) | RJ-45 Ethernet (x1) | Internal SATA (x3)
Run a bounded scroll-and-observe loop
This example assumes an append-only feed with items matching .feed-item and loading triggered by scrolling the viewport. Replace the selector and scroll action for the site you are capturing. It limits both each wait and the total number of rounds, and treats only a timeout as evidence that no new items arrived.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({ headless: true });
try {
const page = await browser.newPage();
await page.goto('https://example.com/feed', {
waitUntil: 'domcontentloaded',
timeout: 30000,
});
const itemSelector = '.feed-item';
const maxRounds = 30;
const stableRoundsRequired = 3;
const waitForNewItemsMs = 5000;
let unchangedRounds = 0;
let previousCount = await page.locator(itemSelector).count();
for (let round = 0;
round < maxRounds && unchangedRounds < stableRoundsRequired;
round++) {
await page.evaluate(() => {
window.scrollTo(0, document.body.scrollHeight);
});
try {
await page.waitForFunction(
(selector, count) =>
document.querySelectorAll(selector).length > count,
{ timeout: waitForNewItemsMs, polling: 'mutation' },
itemSelector,
previousCount,
);
previousCount = await page.locator(itemSelector).count();
unchangedRounds = 0;
} catch (error) {
if (error.name !== 'TimeoutError') throw error;
unchangedRounds++;
}
}
if (unchangedRounds < stableRoundsRequired) {
throw new Error(`Reached ${maxRounds} scroll rounds before the feed stabilized`);
}
await page.screenshot({ path: 'page.png', fullPage: true });
} finally {
await browser.close();
}
})();
The three unchanged rounds, five-second wait, and 30-round ceiling above are tunable example values, not Puppeteer recommendations. A timeout means only that the chosen signal did not change within the wait window; a slow response can look like completion. Increase the wait if the site loads slowly, or use a loading/end marker when available. The round ceiling prevents an endless loop if the page keeps changing or the signal never settles.
Rank #2
- Model: Dell OptiPlex 7050 Small Form Factor (SFF)
- Processor: Intel Core i7-7700 3.60 GHz
- Memory: 32GB DDR4 Ram
- Storage: 1TB Solid State Drive (SSD) Fast Boot + Storage
- Operating System: Windows 11 Pro (64-bit)
For a feed that replaces old items, checking whether the count increased will stop prematurely. Instead, compare the newest stable item ID before and after scrolling, or wait for a site-specific loading state to finish and then test an end marker. If you use an item element directly, note that an element screenshot can fail if that element detaches while a virtualized feed recycles its nodes.
Recommended Free Tools
Capture the viewport, full page, or one element
Puppeteer’s screenshot guide documents Page.screenshot(). By default, it captures the viewport; set fullPage: true to request a screenshot of the full document after the feed has accumulated. Full-page capture does not itself load additional feed items—the scroll-and-observe loop must do that first.
Rank #3
- IMMERSIVE 24 INCH DISPLAY: Experience stunning clarity on a Full HD IPS screen with ultra-thin bezels, offering a 90% screen-to-body ratio that makes everything from spreadsheets to streaming come alive with vibrant colors and crisp details.
- POWERFUL INTEL PROCESSING: Tackle demanding tasks with ease thanks to the Intel processor and 16GB of high-speed memory, delivering smooth performance whether you're multitasking between applications or running productivity software.
- GENEROUS STORAGE: Store all your important files, photos, and programs with blazing-fast solid state drive technology that ensures quick boot times, rapid file access, and plenty of space for your digital life.
- ENHANCED PRIVACY AND COLLABORATION: Work confidently with the pop-up privacy camera that tucks away when not in use, plus dual microphones with noise reduction for crystal-clear video calls that keep you connected professionally.
- ECO-CONSCIOUS DESIGN: Feel good about your purchase with an EPEAT Gold registered and ENERGY STAR certified computer that combines premium performance with responsible environmental manufacturing practices.
- Viewport: omit
fullPagewhen the desired artifact is the visible state at the end of scrolling. - Accumulated document: use
fullPage: truewhen the page has appended the items and the entire document should appear in the image. - One element: use an element screenshot when only a specific feed region is needed. Puppeteer scrolls the element into view, but the operation throws if that element has detached from the DOM.
Troubleshoot common failures
The loop stops although more items exist
Check whether the feed uses a nested scroll container, whether the item selector matches the newly loaded markup, and whether the site needs more than the wait window to respond. A viewport scroll cannot reliably trigger a feed whose own container must be scrolled.
The count never increases
The selector may not match the items, or the feed may replace existing nodes instead of appending them. Verify the selector in the page and switch to a signal such as newest item ID, loading state, or end marker that fits the feed’s behavior.
Rank #4
- This Certified Refurbished product is tested and certified to look and work like new. The refurbishing process includes functionality testing, basic cleaning, inspection, and repackaging. The product ships with all relevant accessories, a minimum 90-day warranty, and may arrive in a generic box. Only select sellers who maintain a high-performance bar may offer Certified Refurbished products on Amazon.com.
- Dell Optiplex 3050 SFF Desktop computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD
- Includes: USB Keyboard & Mouse, USB WiFi adapter, Microsoft office 30 days free trail.
- Port: Front: USB 3.0(2), USB 2.0(2); Rear: DP, HDMI, USB 3.0(2), USB 2.0(2), RJ-45.
- Support 4K (3840x2160) Dual display, makes it easy to connect two monitors at the same time, and you can expand working Windows, mirror content, or expand a single window across multiple monitors.
The loop never reaches its stability threshold
The page may append content on every scroll, or the chosen signal may keep changing for reasons unrelated to new feed items. Retain a maximum-round limit and inspect the signal; do not remove the bound to force a capture.
Free tools Windows power users keep installed
One-click scans. No signup required.
An element screenshot reports a detached node
A virtualized feed may recycle or remove the target element between selection and capture. Re-find the element after the feed settles, or capture the page/document instead of retaining a handle to a transient node.
Best Value
- Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections
- Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
- Storage: Combines 500GB SSD and 1TB HDD for ample storage space
- Graphics: Integrated Intel UHD Graphics 630 for crisp visuals and video playback
- Design: Sleek desktop tower with black color and slim profile for modern look
Or skip the browser setup
If you need a screenshot rather than a Puppeteer-controlled infinite-scroll workflow, ScreenshotNeo takes a screenshot from one GET request. For example, this cURL request saves a WebP shot of a page:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its MCP server lets AI agents take screenshots. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month, no card required.
Frequently Asked Questions
Does Puppeteer provide an infinite-scroll completion event?
No. Use a condition tied to the target page, such as a feed end marker or a meaningful content change, and stop after a bounded stability period.
Will a full-page screenshot load more feed items?
No. Scroll and wait for the feed to load items first; fullPage: true controls what the screenshot includes.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




