Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

Puppeteer Screenshot After Infinite Scroll Stops Adding Items

A bounded Puppeteer loop for waiting until an infinite feed stops adding items, with signal choices, screenshot options, and fixes for common failures.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
Dell Optiplex 3060 Desktop Computer | Intel i5-8500 (3.2) | 32GB DDR4 RAM | 1TB SSD Solid State | Built in WiFi | Bluetooth | Windows 11 Professional | Home or Office PC (Renewed)
  • [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
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
Sale
HP All-in-OneDesktop Computer, 16GB DDR5 RAM, Intel Quad-Cores, 128GB SSD, WiFi6, Keyboard & Mouse, Windows 11
  • 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 fullPage when the desired artifact is the visible state at the end of scrolling.
  • Accumulated document: use fullPage: true when 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
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
  • 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
  • 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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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

Bestseller No. 2
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Dell Optiplex 7050 SFF Desktop PC Intel i7-7700 4-Cores 3.60GHz 32GB DDR4 1TB SSD WiFi BT HDMI Duel Monitor Support Windows 11 Pro Excellent Condition(Renewed)
Model: Dell OptiPlex 7050 Small Form Factor (SFF); Processor: Intel Core i7-7700 3.60 GHz; Memory: 32GB DDR4 Ram
$389.99
Bestseller No. 4
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
Dell Optiplex 3050 SFF Desktop Computer PC, Intel Quad Core i5-6500 up to 3.6GHz, 16GB DDR4, 256GB SSD, WiFi, 4K Support, DP, HDMI, Windows 11 Pro 64 Bit (Renewed)
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.
$179.98
Bestseller No. 5
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Dell Windows 11 Desktop Computer OptiPlex 5060 | Intel Core i5-8500 Six Core (4.3GHz Turbo) | 16GB DDR4 RAM | 500GB SSD Solid State + 1TB HDD | WiFi + Bluetooth | Home or Office PC (Renewed)
Connectivity: Includes WiFi, Bluetooth, and LAN for wireless and wired connections; Memory: Features 16GB DDR4 RAM for smooth multitasking and performance
$255.00

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.