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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

For a screenshot of the webpage, use browser automation rather than minimizing a normal browser window. Playwright can capture page content in headless mode, without relying on a visible window. If the image must include browser tabs, the address bar, or other desktop content, use a Windows window-capture method instead. Capturing an occluded window is documented for Windows Graphics Capture (WGC), but that is not a guarantee that every minimized browser will work in every Windows session.

First choose what the screenshot needs to show

“Screenshot of a browser” can mean two different things. A page screenshot records rendered web content. A window or desktop screenshot records pixels from an application window and may include browser chrome such as tabs and the address bar. Choose the capture route by the output you need, not by whether the browser happens to be minimized.

What you need Use Important limitation
Webpage content, unattended Headless browser automation, such as Playwright It captures the page, not browser tabs or the address bar.
Current page in an existing WebDriver session Selenium WebDriver screenshot Minimization behavior depends on the window manager.
Browser frame, tabs, or address bar Windows window-capture tooling Occluded-window support is not a universal guarantee for minimized windows.
Menus, tooltips, or other on-screen overlays A screen-capture path that brings the target forward The target must actually reach the foreground; otherwise capture can fail.

Playwright and Selenium screenshots capture page or browsing-context content; do not treat them as a way to capture browser chrome. Microsoft’s Windows UI automation screenshot tooling uses WGC by default and PrintWindow as a fallback when WGC is unavailable. Microsoft documents WGC capture of an occluded window, but that statement does not establish identical behavior for every minimized Chrome, Edge, or Firefox window, Windows build, or session.

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

Capture webpage content with headless Playwright

When only the webpage matters, headless automation is usually the simplest unattended approach: it renders the page and saves an image without keeping an ordinary browser window visible. Playwright launches headless browsers by default. The example below uses Node.js and the Playwright package; it navigates to a URL and captures the full page.

  1. Install Node.js and create a project directory.
  2. Install Playwright: run npm init -y, then npm install playwright.
  3. Install a browser binary: run npx playwright install chromium.
  4. Save the script as capture.js, replacing the example URL as needed.
  5. Run it: node capture.js. The image is written to page.png.

capture.js

const { chromium } = require('playwright');

(async () => {
  const browser = await chromium.launch();
  try {
    const page = await browser.newPage({ viewport: { width: 1440, height: 900 } });
    await page.goto('https://example.com', { waitUntil: 'networkidle', timeout: 60000 });
    await page.screenshot({ path: 'page.png', fullPage: true });
  } finally {
    await browser.close();
  }
})();

The fixed viewport gives the page a defined layout width. fullPage: true asks Playwright to capture the page’s full scrollable extent rather than just the visible viewport. If you need only the initial viewport, omit that option. Full-page capture can produce a very tall image on long pages.

Choose a wait condition that fits the site

networkidle waits for network activity to settle, which can help on ordinary static pages but may never settle on pages with persistent polling or long-lived requests. In that case, wait for the meaningful element instead, using Playwright’s locator API, or use an explicit delay if the page needs a short rendering pause. Conversely, a screenshot taken immediately after navigation may precede client-side rendering or image loading. Set a finite navigation timeout so the script fails clearly instead of waiting indefinitely.

Capture one element instead of the whole page

For a chart, card, or other component, locate it and take an element screenshot:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const card = page.locator('.report-card');
await card.screenshot({ path: 'card.png' });

Replace .report-card with a selector that identifies the desired element. If the selector matches nothing or matches an unexpected element, the capture will fail or produce the wrong output; inspect the page and choose a stable selector.

Use Selenium when the page is already under WebDriver control

Selenium’s WebDriver screenshot endpoint captures the current browsing context. It can be a natural fit if the application already uses Selenium to navigate and test the page. The screenshot is still page content, not a picture of browser tabs or the desktop.

In Python, after creating a WebDriver and navigating, save the current page screenshot with:

driver.get("https://example.com")
driver.save_screenshot("page.png")

Use the screenshot call after the page has reached the state you need; navigation completing does not always mean all asynchronous content is ready. Wait for a relevant element or other application-specific condition before capturing. Selenium documents minimization behavior as specific to the window manager, so do not assume that a minimized Selenium-controlled window will behave consistently across environments.

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

Capture browser chrome or a Windows window

If the required image must show the address bar, tabs, browser menus, or desktop context, a page screenshot is the wrong tool. Use a window-targeted capture path on Windows. Microsoft’s Windows UI automation screenshot command uses Windows.Graphics.Capture by default and falls back to PrintWindow if WGC is unavailable. Microsoft documents WGC as able to capture a window while it is occluded—that is, covered by another window.

Occluded is not the same as minimized. The documentation does not promise that all minimized browsers will be captured identically across Windows versions, browser implementations, or interactive sessions. Test the particular browser, Windows build, session type, and minimized state you intend to use. If the exact minimized case fails, options include leaving the window occluded rather than minimized, or switching to headless page automation if browser chrome is not required.

When the capture needs a menu or tooltip

A menu or tooltip may exist only while the browser is active and the relevant control is hovered, focused, or clicked. Microsoft’s screen-capture guidance brings the target window forward; it can fail if the target does not actually become the foreground window. That behavior is different from a quiet background capture. If you must show such an overlay, arrange the interaction and foreground state explicitly, and confirm the saved image is of the intended window.

Interactive Snipping Tool versus unattended capture

Windows Snipping Tool supports interactive window, rectangle, and freeform capture modes. That can be useful for a person taking a one-off screenshot, but it is not a general unattended API for screenshots of minimized windows. Its documented URI integration routes a response back to packaged MSIX applications; unpackaged Win32 callers cannot receive the response through redirect-uri. Treat this as an interactive capture flow rather than a substitute for browser automation.

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

Or skip the browser setup

If the desired result is a clean webpage image rather than browser chrome, ScreenshotNeo provides a screenshot API: one GET request can return a PNG, JPEG, WebP, or PDF. Its consent-banner, newsletter-popup, and chat-widget cleanup can be disabled step by step. Its response headers identify page verdict and billing status; bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. It also offers an MCP server with screenshot tools for AI clients including Claude and Cursor. The API accepts parameter names used by other screenshot APIs as well, which can make switching simpler. It captures webpage output, not browser chrome.

See the ScreenshotNeo API documentation. Example cURL request:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

Replace YOUR_API_KEY with your key. The example saves the returned image as shot.webp. ScreenshotNeo’s free plan includes 1,000 screenshots per month without a card; paid plans start at $5 for 3,000 screenshots. Sign up for free and try 1,000 screenshots a month with no card.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting failed or incorrect captures

  • The image contains only the page, not tabs or the address bar: that is the expected output of Playwright or Selenium page screenshots. Use a window-capture method if chrome is required.
  • The page is blank or missing content: wait for the relevant element or application state before capture. A navigation event alone may precede client-side rendering.
  • The script waits indefinitely: use a finite timeout. A page that keeps network connections active may not reach networkidle; wait for a specific element or use a deliberate bounded delay instead.
  • A full-page image is too large: capture only the viewport or a selected element. Full-page capture intentionally includes content beyond the initial viewport.
  • A minimized window capture is black, stale, or absent: do not infer that all Windows capture paths behave alike. Test as an occluded window, confirm WGC availability and the actual session conditions, or use headless page capture if chrome is unnecessary.
  • The wrong window was captured or capture fails around an overlay: screen capture may require the target to be foregrounded. Bring it forward and verify foreground state before capturing.
  • Snipping Tool does not return a response to a desktop caller: its documented redirect-uri response path applies to packaged MSIX applications, not unpackaged Win32 callers.

Test the exact state you need

Before relying on screenshots in a scheduled job or desktop workflow, run a small verification matrix rather than assuming “background” means the same thing everywhere:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Confirm whether the expected output is webpage content or the complete browser window.
  • Test the exact browser, Windows build, and session type used in production.
  • For window capture, test both an occluded window and a minimized window separately.
  • Check whether the target is actually foregrounded when menus, popups, or tooltips must appear.
  • Open the saved image and verify it shows the intended page, viewport, and state before automating the workflow.

There is no single documented reliability ranking across these approaches: the cited documentation describes different capture targets and conditions, not a controlled cross-browser comparison. Choose the method that matches the pixels you need and validate that precise environment.

Frequently Asked Questions

Does a Playwright screenshot include the browser’s address bar?

No. Playwright’s page screenshot captures webpage content. Use a window-capture method when browser chrome must be visible.

Is an occluded window the same as a minimized window?

No. Occluded means another window covers it; minimized means it has been minimized. Microsoft documents WGC support for occluded-window capture but does not establish a universal guarantee for minimized browsers.

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.

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