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.

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

In Playwright’s asynchronous APIs, take a screenshot by awaiting the screenshot method: Python uses await page.screenshot(path="screenshot.png"); JavaScript uses await page.screenshot({ path: 'screenshot.png' }). The call belongs after navigation or other page setup that must finish first. “Asynchronous” describes how your program waits for the operation; it does not mean “full page.” For a full-page image, set full_page=True in Python or fullPage: true in JavaScript.

Choose the right async API for your project

Playwright offers a synchronous and an asynchronous Python API, as well as JavaScript and other language bindings. If your Python program uses asyncio, use playwright.async_api and await Playwright operations. Do not mix the synchronous Python API’s calling style with an asyncio workflow. In Node.js, use the ordinary Playwright package and async/await.

The central rule is simple: each asynchronous operation your next step depends on must be awaited. In a screenshot workflow, that usually means awaiting browser launch, page setup, navigation, and the screenshot itself. If the screenshot is intended to show a state reached after a click or another interaction, await that action before capture as well. Otherwise, your code may proceed before the required operation has completed.

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

Python: capture a page with asyncio

This complete example opens Chromium, visits a page, saves a full-page PNG, then closes the browser. It uses the asynchronous Python binding throughout:

#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
import asyncio
from playwright.async_api import async_playwright

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

asyncio.run(main())

The async with block manages the Playwright context. The try/finally ensures the browser is closed even if navigation or capture raises an error. For a viewport-only screenshot, remove full_page=True. The result is written to the path you provide.

Put the capture after the state you want

Navigation must be awaited before capture when the screenshot should show the navigated page. The same sequencing applies to interactions: await the action that changes the page, then await the screenshot. For example, the pattern is await page.goto(...), followed by any required awaited interaction, followed by await page.screenshot(...). This makes the intended ordering explicit; it does not by itself guarantee that every site-specific asynchronous visual element has finished rendering.

Node.js: capture a page with async/await

In JavaScript, the full-page option is camel-cased. This CommonJS example follows the same lifecycle: launch, create a page, navigate, capture, and close.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.
const { chromium } = require('playwright');

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

Use fullPage: true when the image should include the full scrollable page. Omit it for the current viewport. If your project uses ES modules, the equivalent import style depends on your project configuration; the awaited API calls and option spelling remain the same.

Viewport, full-page, or element capture

Pick the capture scope based on the image you need, not on whether the method is asynchronous. A regular page screenshot captures the visible viewport; full-page capture extends to the full scrollable page; a locator screenshot targets one element.

Goal Python async JavaScript
Visible viewport await page.screenshot(path="view.png") await page.screenshot({ path: 'view.png' })
Full scrollable page await page.screenshot(path="full.png", full_page=True) await page.screenshot({ path: 'full.png', fullPage: true })
One element await page.locator(".header").screenshot(path="header.png") await page.locator('.header').screenshot({ path: 'header.png' })

Playwright describes full-page capture as taking the page as if it were displayed on a sufficiently tall screen. It is useful for a whole-page record, but it is not the same as a viewport screenshot. An element capture is useful when the output should be limited to a matched element rather than the whole viewport. The element must be identified by a locator that matches the intended content.

Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Save to disk or keep the screenshot in memory

Provide path when you want Playwright to write the image to a file. If you omit the path and await the method, the API returns the image data: Python returns screenshot bytes, while JavaScript returns a buffer. That lets a program pass the result to a later processing step without first choosing a filesystem path. The Playwright screenshots guide also demonstrates base64 encoding for downstream use.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
# Python: keep screenshot bytes in memory
image_bytes = await page.screenshot()

# JavaScript: keep the screenshot buffer in memory
const imageBuffer = await page.screenshot();

Choose one destination approach deliberately. A path is straightforward for a local artifact or later inspection. In-memory bytes or a buffer are convenient when another part of the program consumes the image directly. If you need both, capture the returned data and write it using your application’s normal file or storage logic.

Stabilize the page before capturing

Awaiting screenshot() ensures your program waits for the capture operation; it does not decide which page state you intended to capture. Arrange page setup before the screenshot: navigate, perform the needed interaction, and use the appropriate screenshot scope. For element images where animation would make the result inconsistent, the Python Locator API documents an animations="disabled" option.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
await page.locator(".header").screenshot(
    path="header.png",
    animations="disabled",
)

Screenshot options also cover image format, a clip area, and quality. Exact option names, defaults, and limits vary by API and should be checked in the current language-specific reference before relying on a particular output format or constraint. In particular, keep Python’s underscore spelling and JavaScript’s camel-case spelling distinct when translating options.

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

Common failures and practical fixes

  • The screenshot line is not awaited. In an async flow, call await page.screenshot(...). Without awaiting it, the surrounding code does not explicitly wait for capture completion before proceeding.
  • Python reports that the operation cannot be used in the current style. Confirm that an asyncio program imports from playwright.async_api and uses awaited calls. Playwright also has a synchronous Python API, but its style is not interchangeable with the async binding.
  • The image shows the viewport instead of the full document. Add full_page=True in Python or fullPage: true in JavaScript. The option names are not interchangeable.
  • The captured element is not the one intended. Check the locator selector and make sure it identifies the target element before calling its screenshot method. Element capture is scoped to the locator, not the entire page.
  • The screenshot is missing a later page state. Await the navigation or interaction that should precede capture, and place the screenshot call afterward. Awaiting the screenshot cannot compensate for taking it before the page reaches the state you want.
  • Your next step cannot use a file that is not ready. Await the screenshot before reading, uploading, or otherwise using its output. If capturing without a path, retain the returned bytes or buffer and pass that value onward.
  • Python and JavaScript snippets do not translate line for line. Python uses keyword arguments such as full_page=True; JavaScript uses an options object with fullPage: true. Use the spelling and calling convention for your binding.

Performance, reliability, and output choices

A screenshot is one step in a browser workflow, so the total time also includes the browser and page work your code performs before capture. Full-page capture requests a larger scope than viewport capture; use it only when the complete scrollable page is required. An element screenshot narrows the target. Keeping output in memory avoids choosing a file path but means your program must manage the returned data. Saving to a path produces a file that can be inspected or consumed by a later step.

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

For repeatable output, make the capture sequence explicit and clean up the browser in a finally path. If the result looks inconsistent, first verify the requested scope and the ordering of awaited operations; then consult the API reference for the exact format, clipping, quality, and animation options supported by your installed Playwright version. The official API evolves, and defaults or limits should not be assumed from a snippet written for a different release.

Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

Or skip the browser setup

If your goal is a website screenshot rather than specifically exercising Playwright in your own browser automation, ScreenshotNeo offers a single GET request that returns an image or PDF. Its clean-shot flow accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents.

For example, this cURL call saves a WebP screenshot:

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. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan to try it.

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

Frequently Asked Questions

Does asynchronous screenshot mean that the image is full-page?

No. Async describes awaiting the operation; full-page is a separate capture option.

Can Playwright return a screenshot without creating a file?

Yes. Omit the path and await the method to receive image data in memory.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.90
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

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.