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

Await Playwright’s screenshot operation inside your asynchronous workflow. In Python’s asyncio API, use await page.screenshot(path="screenshot.png"); in Node.js, use await page.screenshot({ path: 'screenshot.png' }). Await navigation and browser setup as well, then close the browser after the image has been written or returned.

What “asynchronous screenshot” means in Playwright

Asynchronous refers to how your program runs the API call: the screenshot promise or coroutine must be awaited. It does not mean that the image is automatically a full-page capture. Scope is a separate choice:

  • A normal page screenshot captures the current viewport.
  • A full-page screenshot captures the entire scrollable document.
  • A locator screenshot captures one element.

The spelling of options follows the language binding. Python uses names such as full_page=True; JavaScript uses fullPage: true. Omitting path keeps the image data in memory instead of writing a file.

Python asyncio: capture a page and await every step

Use Playwright’s asynchronous Python binding when the rest of your application uses asyncio. The context manager closes Playwright resources, while the explicit browser close releases the browser process.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents
import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        page = await browser.new_page()
        await page.goto("https://example.com")
        await page.screenshot(path="screenshot.png", full_page=True)
        await browser.close()

asyncio.run(main())

The important ordering is deliberate: launch, create a page, await navigation, await the screenshot, and only then close the browser. If you close the browser before the screenshot coroutine finishes, the capture can be interrupted.

Viewport-only Python capture

await page.screenshot(path="viewport.png")

Leave out full_page when you want exactly what is visible in the current viewport rather than the complete scrollable page.

Capture an element with a locator

header = page.locator(".header")
await header.screenshot(path="header.png")

The locator method waits for the target element to be available and captures that element’s rendered box. For a stable image of an animated element, the Python locator API supports animations="disabled":

await page.locator(".header").screenshot(
    path="header-still.png",
    animations="disabled",
)

Keep the result in memory

image_bytes = await page.screenshot(full_page=True)
# Pass image_bytes to your storage or processing code.

When path is omitted, the Python API returns screenshot bytes. This is useful when an upload, hash, image transform, or HTTP response should receive the image without a temporary file.

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.
Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

Node.js async/await: capture a page and close cleanly

In Node.js, the screenshot call returns a promise. Await it along with navigation and browser creation.

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

(async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();
  await page.goto('https://example.com');
  await page.screenshot({ path: 'screenshot.png', fullPage: true });
  await browser.close();
})();

Viewport and element captures in Node.js

await page.screenshot({ path: 'viewport.png' });
await page.locator('.header').screenshot({ path: 'header.png' });

As in Python, omit the output path to receive image data instead:

const imageBuffer = await page.screenshot({ fullPage: true });
// Send imageBuffer to storage, an upload, or another API.

Choose the capture scope and destination

Need Python Node.js Result
Current viewport await page.screenshot(path="shot.png") await page.screenshot({ path: 'shot.png' }) Visible viewport only
Entire scrollable page full_page=True fullPage: true Full document as if displayed on a sufficiently tall screen
One element await page.locator(".card").screenshot(path="card.png") await page.locator('.card').screenshot({ path: 'card.png' }) Rendered bounds of the matched element
In-memory output Omit path Omit path Python bytes or a JavaScript buffer

Playwright’s screenshots API also accepts parameters for image format, clipping area, quality and related output controls. Use the option names and limits in the API reference for the language binding you are using; Python and JavaScript do not always spell the same option identically.

Make asynchronous captures deterministic

Await navigation before the screenshot

A screenshot taken before navigation has completed can contain the previous document, a loading state or an incomplete layout. Keep the navigation call in the same awaited sequence as the capture:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.
await page.goto("https://example.com")
await page.screenshot(path="after-navigation.png")

The same rule applies in Node.js with await page.goto(...) followed by await page.screenshot(...).

Use the right scope for long pages

full_page/fullPage asks Playwright to capture the complete scrollable page. It is not a replacement for waiting on content that appears later. If images, fonts or application data are still loading, wait for the condition your page requires before awaiting the screenshot.

Stabilize animated elements

Animations can change pixels between runs. Element screenshots in Python can disable animations with animations="disabled". For other cases, choose a stable application state before capture rather than relying on a timing guess.

Save or process without a file

Use a path when a durable artifact is needed for a build or test report. Use returned bytes or a buffer when the next step is an upload, response, or transformation. In-memory handling avoids temporary-file cleanup but still requires you to consume the result before closing the browser.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Common failures and fixes

  • The file is missing or empty: confirm that the screenshot call is awaited and that the destination directory exists and is writable. Do not close the browser until the await has resolved.
  • The image shows a loading page: navigation or application rendering has not reached the state you need. Await navigation and an application-specific readiness condition before capturing.
  • The whole page is not included: add full_page=True in Python or fullPage: true in Node.js. A normal screenshot is viewport-only.
  • An element capture fails: verify the selector and use a locator that identifies the intended element. The locator screenshot operates on one matched element, not the entire page.
  • Python raises an event-loop error: keep the Playwright calls inside an async function run by your application’s event loop and use playwright.async_api, not the synchronous binding, for that workflow.
  • The result is inconsistent between runs: wait for the same page state each time and disable locator animations where the Python API supports it. Differences in fonts, late images or changing data can alter pixels even when the code is correct.
  • Memory use grows during batches: write or upload each returned image promptly, close pages you no longer need, and close the browser when the batch ends. A full-page image is larger than a viewport capture.

Performance and reliability decisions

Viewport versus full page

Viewport captures generally involve less image data and are appropriate for responsive checks or above-the-fold previews. Full-page captures provide document coverage but can be substantially taller, so use them only when the complete scrollable layout is required.

File output versus memory

Writing directly to a path gives you a named artifact for reports and archives. Returning bytes or a buffer is convenient for pipelines that immediately upload or transform the image. Neither mode removes the need to await the operation.

Browser lifecycle

Keep one browser alive when taking several related screenshots, create pages as needed, and close pages and the browser in a controlled shutdown path. For a single capture, the compact examples above are sufficient. Always let the screenshot await finish before teardown.

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

Or skip the browser setup

ScreenshotNeo provides a website screenshot API when you do not want to install or operate a Playwright browser. One GET request returns a PNG, JPEG, WebP or PDF. Before capture it accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers identify the page verdict and whether the request was billed.

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

For AI workflows, its MCP server exposes take_screenshot, get_page_info and capture_pdf to Claude, Cursor and other MCP clients. The service also supports full-page captures with lazy images loaded, CSS-selector element captures, dark mode, 12 device presets plus custom viewports, retina scale, PDF paper size/margins/landscape/page ranges, HTML/CSS-to-image, custom CSS and JavaScript, pre-capture clicks, selector/delay/network-idle waits, ad/tracker/request/resource blocking, custom headers/cookies/user agents/Authorization, timezone and geolocation, transparent backgrounds, resizing, configurable-TTL caching, signed image links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API and an OpenAPI specification. Common parameter names from other screenshot APIs are accepted to ease migration.

Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for authentication and options. Equivalent Python and Node.js calls are:

import requests
r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.com"},
    timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
const image = Buffer.from(await res.arrayBuffer());

Every feature is included on every plan. The Free plan includes 1,000 shots per month with no card; paid plans are Starter ($5 for 3,000), Growth ($15 for 15,000), Pro ($39 for 60,000), Scale ($99 for 250,000) and Business ($249 for 1,000,000). Yearly billing gives two months free. Create a free ScreenshotNeo account to get the 1,000 monthly shots without a card.

Frequently Asked Questions

Is an asynchronous screenshot automatically full page?

No. Asynchronous describes awaiting the operation. Select full-page capture explicitly with Python’s full_page=True or Node.js’s fullPage: true.

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

Can I send a screenshot directly to another service?

Yes. Omit path; Python returns bytes and Node.js returns a buffer that your code can upload or process before closing the browser.

Which Python binding belongs in an asyncio application?

Use Playwright’s playwright.async_api binding and await browser creation, navigation and screenshot calls inside your coroutine.

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.