logo of Screenshot for Web
Free toolsPlaygroundDocsBlogPricing
LoginDashboard

Company

HomeFeaturesPricingBlogFacts

Screenshot Tools

Website ScreenshotsFull Page ScreenshotsScrolling ScreenshotsWebsite HistoryPDF Generation APIScreenshot API

Legal

Terms of UsePrivacy PolicyCookie PolicyCopyrightSecurity

Support

FAQSupportContact UsAPI Status
screen shot for web logo

No clutter. No distractions. Just clean, full-page screenshots with smart customization.

© 2026 HYDRANODE LTD. All rights reserved.

Screenshot for Web is operated by HYDRANODE LTD, a company registered in England and Wales, company number 15672526. Registered office: 124 City Road, London, London, England, EC1V 2NX.

FacebookInstagramLinkedInYouTube
  1. Home
  2. Blog
  3. Guides

Full-page screenshots with Puppeteer, and the three things that go wrong

How fullPage works in Puppeteer, and the three failures we hit on 15 real sites: scroll-triggered content, fixed overlays and inner scroll containers, with fixes.

Screenshot for Web·October 22, 2026·9 min read

Sources

  1. Puppeteer: ScreenshotOptions interface
  2. Puppeteer: Page.screenshot() method
  3. Puppeteer source: packages/puppeteer-core/src/api/Page.ts
  4. Chrome DevTools Protocol: Page domain (Page.pdl), captureScreenshot
  5. MDN: position
  6. MDN: Intersection Observer API
  7. MDN: overflow

How this article was made

Researched and drafted with AI assistance from the sources listed. All tests, captures and code were run by us on 22 October 2026 on an Apple M5 Mac (macOS 26.6, Node 22.21.1) with Puppeteer 25.15.0, the current release, on its bundled Chrome for Testing 155.0.8059.84; the local test pages were also run on Chrome 156.0.8078.47 with identical results. Every number in the article comes from those runs.

Capture any page without ads, banners or chat widgets, free and without an account.

Try the free tools

More articles

  • News

    Puppeteer 25.19 stops print and dark mode emulation from cancelling each other

    Before Puppeteer 25.19.0, emulateMediaType and emulateMediaFeatures reset each other, losing print or dark mode. Our tests, the fix and a workaround.

    November 26, 2026
  • News

    Chrome 158 drops XSLT: what it does to screenshots of sitemaps and feeds

    We captured eight live sitemaps in Chrome 156 and Chromium 158. Styled pages turn into raw XML, a red warning bar is already in captures, and two fixes work.

    November 9, 2026
  • Research

    Chrome DevTools' full-size screenshot: where it fails on long and lazy pages

    We ran DevTools' full-size screenshot on six long pages: it stops at 16,384 pixels and misses content that appears on scroll. Here's why, and the fixes that worked.

    November 8, 2026

A full-page screenshot in Puppeteer is one option: page.screenshot({ fullPage: true }). It works on simple pages. On modern sites it fails in three ways that give no error: sections that only appear when scrolled into view come out blank, fixed elements such as cookie bars land in the middle of the image, and apps that scroll inside a container give you one screen instead of the page.

This guide shows the basic call, explains how Puppeteer captures beyond the viewport, and then takes each failure in turn with what we measured on 15 real sites and on local test pages, and the code that fixed it. The full script is at the end.

The basic call

Set a viewport, load the page, and pass fullPage: true:

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setViewport({ width: 1280, height: 800 });
  await page.goto('https://www.python.org', { waitUntil: 'networkidle2' });
  const image = await page.screenshot({ path: 'python-org.png', fullPage: true });
  console.log(`${image.length} bytes, ${image.readUInt32BE(16)} × ${image.readUInt32BE(20)} px`);
  await browser.close();
})();

Output, run twice on 22 October 2026:

472713 bytes, 1280 × 2632 px
473230 bytes, 1280 × 2632 px

The width is the viewport width. The height is the document's scroll height at the moment of the call, 2,632 px here. Python.org is a plain document that scrolls normally, so this is all it needs.

How Puppeteer captures beyond the viewport

An ordinary screenshot covers only the viewport. To get more, Puppeteer sends the DevTools Protocol command Page.captureScreenshot with captureBeyondViewport: true, which asks Chrome to render the whole document into one image while the page keeps its 1280 × 800 viewport. The protocol marks that flag experimental and defaults it to false.

Puppeteer's documentation says captureBeyondViewport defaults to false when there's no clip. That's true for ordinary screenshots, but not for full-page ones: in the 25.15.0 source, setDefaultScreenshotOptions sets it to true, and it is only switched off for screenshots that are neither full-page nor clipped. If you pass captureBeyondViewport: false yourself with fullPage: true, Puppeteer uses a different method: it resizes the viewport to the document's full scroll height, captures, and resizes it back.

The difference matters, because in the default mode the page still believes its viewport is 800 px tall. Most of what follows comes from that.

How we tested

On 22 October 2026 we loaded 15 home pages with a 1280 × 800 viewport: GitHub, React, MDN, Hacker News, GOV.UK, BBC, Shopify, Linear, Apple, Python.org, Node.js, Spotify's web player, Notion, Vercel and Figma. Each page was captured in a fresh browser context, with both values of captureBeyondViewport, and we recorded the document height at the load event and after the network went quiet. We then captured seven of them twice more, plain and with the fixes below, and timed both. We also built three local test pages: one with a fixed header, a fixed bottom bar, a sticky navigation bar and a hero sized 100vh; one whose content scrolls inside a div; and one that adds its content 1.5 seconds after load.

Problem 1: content that appears only when scrolled into view

Many sites reveal sections as you scroll: they start hidden or empty and an IntersectionObserver fades them in when they enter the viewport. MDN lists exactly this use: "Deciding whether or not to perform tasks or animation processes based on whether or not the user will see the result". An observer's root defaults to the browser viewport. In the default capture mode the viewport is still the first 800 px, so nothing below it ever intersects, and those sections are captured in their hidden state.

GitHub's home page shows it clearly. The plain full-page capture has large empty panels where product sections should be. After scrolling down one screen at a time and back to the top, the same capture has all of them:

Two full-page captures of github.com side by side. The plain fullPage capture on the left has large dark empty areas where sections should be. The capture on the right, taken after scrolling through the page, shows those sections with their text and product images.

The page's height also changes while content arrives. On 7 of the 15 sites, the document height at the load event differed from the height once the network was quiet:

SiteHeight at loadHeight after network idle
github.com11,099 px11,314 px
developer.mozilla.org2,451 px2,851 px
bbc.com12,586 px7,986 px
shopify.com10,288 px10,618 px
notion.com3,907 px4,511 px
figma.com7,977 px8,377 px
nodejs.org977 px1,021 px

Our local test page showed the extreme case. It renders two blocks, then adds eight more 1.5 seconds later. A capture at load was 808 px tall; two seconds later it was 4,040 px. Puppeteer measures the height when you call screenshot, so the fix is to call it later: wait for the network to go quiet (waitUntil: 'networkidle2' or page.waitForNetworkIdle()), then scroll through the page so scroll-triggered content runs, then go back to the top.

The scroll pass didn't fix every site. On vercel.com the lower sections were empty in both the plain and the scrolled capture. Only the resize method, captureBeyondViewport: false, rendered them, presumably because the whole page is then inside the viewport. That method has its own cost, shown next, so we use it only for sites like this, after checking the result.

Lazy-loaded images are the same problem with a different trigger; we measured those separately in Why full-page screenshots come out with blank images.

Problem 2: fixed elements and 100vh sections

MDN defines a position: fixed element as positioned relative to its initial containing block, "which is the viewport in the case of visual media". In the default capture mode that viewport is the first 800 px of the image. A fixed header therefore appears once, at the top, which is usually what you want. But a fixed bar pinned to the bottom of the screen, such as a cookie notice or a chat button, is drawn at 750 to 800 px, in the middle of the page, on top of whatever is there.

Switching to captureBeyondViewport: false moves the bottom bar to the bottom of the image, but breaks something worse. Puppeteer measures the scroll height first, 4,272 px on our test page, and then resizes the viewport to that height. The hero section, sized height: 100vh, grows from 800 px to 4,272 px, pushes everything else below the edge of the image, and the capture contains nothing but the header, a red hero and the bottom bar. The sticky navigation, eight content blocks and the footer are gone:

Two captures of a test page. Left, default mode: blue fixed header, 800-pixel red hero, orange fixed bottom bar at the foot of the first screen, green sticky bar, content blocks, black footer. Right, captureBeyondViewport false: the red hero fills the image; blocks and footer are missing.

The measured layout of the two captures, both 1,280 × 4,272 px:

ElementDefault modecaptureBeyondViewport: false
Fixed headery = 0y = 0
100vh hero740 px visible below the header4,162 px visible
Fixed bottom bary = 750y = 4,222
Sticky nav, content, footerall present, footer at y = 4,072not in the image

Keep the default mode and deal with the fixed elements instead. Our script hides every visible fixed element that isn't a bar pinned to the top edge. Hiding a consent banner doesn't accept or reject anything; our cookie banner article covers the options in more detail. Consent managers often build their banner inside a shadow root, so the script looks inside open shadow roots too. On notion.com that's where the banner was, and a search of the main document alone missed it.

Problem 3: pages that scroll inside a container

Web apps often fix the document to the window's height and scroll an inner element instead, with CSS such as html, body { height: 100%; overflow: hidden } and overflow-y: auto on a main panel. MDN describes such an element as a scroll container whose overflowing content is "clipped at the element's padding box". The document itself never gets taller than the viewport, so fullPage: true has nothing more to capture.

Spotify's web player was the one site of our 15 built this way. Its document height was exactly 800 px, while its main panel held 1,528 px of content. The plain full-page capture was 1,280 × 800 px with a cookie banner over the lower half. Our script found the tallest scrolling element, removed the height limit and the overflow clipping from it and its ancestors, and the capture grew to 1,592 px with the footer included:

Two captures of the Spotify web player. Left, plain fullPage: one 800-pixel screen with a privacy banner over its lower half. Right, after expanding the scroll container and hiding fixed overlays: 1,592 pixels with artist and album rows and footer; a purple Preview of Spotify bar sits mid-image.

The right-hand image also shows the limit of a generic fix. Spotify's purple "Preview of Spotify" bar isn't a fixed element; it's part of the app's own layout, and after the expansion it sits in the middle of the page. For a site you capture often, add a selector for elements like that and hide them yourself.

The full script

Save it as fullpage.js next to an installed puppeteer package. It exports the three steps and a fullPageScreenshot function that runs them in order, and works from the command line with a URL and an output path.

const puppeteer = require('puppeteer');

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

// Scroll down one screen at a time so scroll-triggered content renders, then go back to the top.
async function scrollThrough(page, { stepDelay = 250, maxSteps = 60 } = {}) {
  for (let step = 0; step < maxSteps; step++) {
    const atBottom = await page.evaluate(() => {
      window.scrollBy(0, window.innerHeight);
      return window.scrollY + window.innerHeight >= document.documentElement.scrollHeight - 2;
    });
    await sleep(stepDelay);
    if (atBottom) break;
  }
  await page.evaluate(() => window.scrollTo(0, 0));
  await sleep(500);
}

// If the document itself doesn't scroll but an element inside it does, let that element grow
// to its full height so the page has something to capture below the first screen.
async function expandScrollContainer(page) {
  return page.evaluate(() => {
    const doc = document.documentElement;
    if (doc.scrollHeight > window.innerHeight + 10) return null;
    let tallest = null;
    for (const el of document.querySelectorAll('body *')) {
      const { overflowY } = getComputedStyle(el);
      if (!/(auto|scroll)/.test(overflowY) || el.scrollHeight <= el.clientHeight + 10) continue;
      if (!tallest || el.scrollHeight > tallest.scrollHeight) tallest = el;
    }
    if (!tallest) return null;
    const before = tallest.scrollHeight;
    for (let el = tallest; el; el = el.parentElement) {
      el.style.setProperty('height', 'auto', 'important');
      el.style.setProperty('max-height', 'none', 'important');
      el.style.setProperty('overflow', 'visible', 'important');
    }
    return { element: tallest.tagName.toLowerCase(), scrollHeight: before, pageHeight: doc.scrollHeight };
  });
}

// Fixed elements stay where they were on the first screen, so a cookie bar or chat button pinned
// to the bottom ends up in the middle of the image. Keep bars pinned to the top edge (headers) and
// hide the rest, including those inside open shadow roots, where consent managers often live.
// Hiding a consent banner doesn't accept or reject anything.
async function hideFixedOverlays(page) {
  return page.evaluate(() => {
    let hidden = 0;
    const visit = (root) => {
      for (const el of root.querySelectorAll('*')) {
        if (el.shadowRoot) visit(el.shadowRoot);
        if (getComputedStyle(el).position !== 'fixed') continue;
        const box = el.getBoundingClientRect();
        if (box.width === 0 || box.height === 0) continue;
        if (box.top <= 0 && box.height < window.innerHeight / 2) continue;
        el.style.setProperty('display', 'none', 'important');
        hidden++;
      }
    };
    visit(document);
    return hidden;
  });
}

async function fullPageScreenshot(page, path) {
  await scrollThrough(page);
  const expanded = await expandScrollContainer(page);
  const hidden = await hideFixedOverlays(page);
  await page.screenshot({ path, fullPage: true });
  return { expanded, hidden };
}

module.exports = { scrollThrough, expandScrollContainer, hideFixedOverlays, fullPageScreenshot };

if (require.main === module) {
  (async () => {
    const [url, path = 'page.png'] = process.argv.slice(2);
    const browser = await puppeteer.launch();
    const page = await browser.newPage();
    await page.setViewport({ width: 1280, height: 800 });
    await page.goto(url, { waitUntil: 'networkidle2' });
    const { expanded, hidden } = await fullPageScreenshot(page, path);
    const height = await page.evaluate(() => document.documentElement.scrollHeight);
    console.log(`${path}: ${height}px tall, ${hidden} fixed overlays hidden`);
    if (expanded) console.log(`expanded a <${expanded.element}> that scrolled ${expanded.scrollHeight}px`);
    await browser.close();
  })();
}

Output for Spotify and GitHub, run on 22 October 2026:

$ node fullpage.js https://open.spotify.com out/run-spotify.png
out/run-spotify.png: 1592px tall, 1 fixed overlays hidden
expanded a <div> that scrolled 1528px
$ node fullpage.js https://github.com out/run-github.png
out/run-github.png: 11573px tall, 2 fixed overlays hidden

What the fixes cost

The scroll pass waits 250 ms per screen and 500 ms at the end, so long pages take longer. Times from starting navigation to having the file, one run each:

SitePlain fullPageWith the scriptHeight, plainHeight, with the script
github.com1.7 s5.9 s11,314 px11,573 px
vercel.com1.6 s3.6 s5,127 px5,670 px
notion.com1.3 s4.8 s4,511 px4,511 px
react.dev1.3 s4.5 s8,857 px9,067 px
linear.app2.3 s5.8 s9,619 px9,619 px
bbc.com1.7 s4.7 s7,986 px7,883 px
open.spotify.com1.7 s2.5 s800 px1,592 px

Up to about four extra seconds per page is the price of a capture closer to what a visitor scrolling the page sees. Lower stepDelay if your pages are light; raise it if reveal animations are slow.

Two more limits

Two other failures come up with full-page captures, and we covered each in its own article. Images with loading="lazy" or data-src stay blank unless the page is scrolled or the images are made eager: see Why full-page screenshots come out with blank images. Very tall pages hit format limits, and Chrome returns an empty WebP above 16,383 device pixels: see The 16,383-pixel WebP limit.

If you'd rather not maintain this, our free screenshot tool and the screenshot API make full-page captures for you.

Checklist

  1. Set the viewport explicitly; the width decides the layout and the image width.
  2. Wait for the network to go quiet before you capture.
  3. Scroll through the page and back to the top so scroll-triggered content renders.
  4. If the document is no taller than the viewport, expand the element that scrolls.
  5. Hide fixed elements that aren't pinned to the top.
  6. Keep the default captureBeyondViewport: true; use false only for a page you've checked, because 100vh sections will grow to the full height.
  7. Look at the result. Each of these failures produces a valid image and no error.