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.

Use Playwright CLI to open a website and save a screenshot from a Linux terminal. Install the CLI, open the URL, then run playwright-cli screenshot --filename=page.png. That captures the current browser viewport; add --full-page when you want the entire scrollable page in one image. The resulting screenshot shows the page as rendered by the selected browser at the selected viewport and page state—not a universal rendering that will look identical in every browser.

Capture a website with Playwright CLI

Playwright CLI is a direct option when you want to take a screenshot interactively from a shell rather than write a browser automation script. The documented quick-start installation uses npm:

npm install -g @playwright/cli@latest

With the CLI installed, open a page and save the visible browser area:

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.
playwright-cli open https://example.com
playwright-cli screenshot --filename=page.png

The CLI runs headless by default, so this workflow does not require a visible browser window. If you want to inspect the browser while it runs, use the CLI’s headed configuration. Refer to the Playwright CLI configuration documentation for the configuration options and exact setup.

For the command names and current options, see Playwright CLI getting started and the screenshot command reference.

Capture the whole page

A normal screenshot captures the current viewport, not every part of a long page. To make one tall image containing the full scrollable page, use --full-page:

playwright-cli open https://example.com
playwright-cli screenshot --full-page --filename=full-page.png

Full-page output is useful for archiving a landing page or reviewing content below the fold. A long page can produce a large image, so consider whether a viewport image or a specific element would be easier to view and share.

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

Choose the capture area, format and resolution

Decide what the image needs to show before choosing options. A screenshot is a record of a particular browser rendering and page state, so choose a capture scope and output that fit the task.

Need Capture choice What to keep in mind
First-screen preview or fixed-height comparison Viewport screenshot Only the area currently visible in the browser is included.
All scrollable content in one image --full-page Long pages can create large, tall files.
One component, such as a form or product panel Element-targeted screenshot The CLI supports targeting an element; consult the command reference for the current selector syntax.
Sharp interface text and edges PNG PNG is the default when no output type is specified and the filename does not determine one.
Alternative image formats JPEG or WebP Both are documented output formats. Choose based on the needs of your downstream workflow.
More device-pixel detail High-resolution mode The image may be larger, and its pixel dimensions can differ from CSS-pixel dimensions.

The CLI uses the filename extension to select a format when it can; otherwise PNG is the default. Name the file with the extension you want, such as page.webp or page.jpg. The documentation lists PNG, JPEG and WebP support; it does not establish one format as best for every use.

High-resolution capture and device-pixel scaling affect how image dimensions relate to the page’s CSS dimensions. If you compare screenshots or feed coordinates into another tool, keep the viewport and scale consistent and check whether that tool expects CSS pixels or image pixels. See the CLI screenshot options and Page API screenshot documentation.

Control browser, viewport and page state

The CLI documentation identifies Chrome as the default browser and documents browser choices including Firefox, WebKit and Microsoft Edge. It also documents headed mode and device or mobile emulation. These controls matter when a screenshot is intended to represent a particular browser or responsive layout: a mobile-emulated page is not evidence of how the same site appears in a desktop viewport.

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

Set and record the browser, viewport, device settings, scale and page state whenever screenshots need to be compared over time. A difference in any of those conditions can change the image even if the URL has not changed. Use the configuration reference for supported CLI browser and device options rather than assuming another browser’s output will match Chrome.

Pages that need interaction or time to settle

A URL alone may not produce the final visual state. Some pages reveal content after interaction, load images as they enter the viewport, or update after scripts run. Playwright provides the mechanisms to navigate and capture, but there is no universal wait setting that guarantees every site’s intended state.

  • If a page requires a consent choice, form entry or menu action, perform the necessary setup before capture.
  • If content appears only after scrolling, scroll or otherwise trigger that behavior before taking the screenshot. For full-page captures, verify that the intended content actually appears in the result.
  • If an animation or rotating banner makes captures inconsistent, choose a repeatable point in the page’s state before capture where possible.
  • If you need reproducible visual comparisons, use the same browser, viewport, device scale, URL and interaction sequence each time.

These are page-specific considerations, not a promise that a particular delay or network condition will work for every site. Review the saved image when the exact content matters.

Use Playwright’s Page API for repeatable capture

For a one-off screenshot, the CLI is convenient. When capture must be part of a program—for example, when a job processes a list of URLs or applies application logic—Playwright’s Page API provides a scripted route. Its documented screenshot API supports saving to a path, full-page capture and device-pixel scaling.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
// JavaScript using a Playwright Page object
await page.goto('https://example.com');
await page.screenshot({ path: 'page.png' });

// Capture the full scrollable page instead:
await page.screenshot({ path: 'full-page.png', fullPage: true });

This snippet assumes your program has already created a Playwright browser context and a page object. It illustrates the documented Page API capture calls, not a complete browser installation or project scaffold. See the Page API reference for the screenshot options and the CLI getting-started documentation for the command-line path.

Use the API when capture is one step in a larger workflow and the program needs to decide what to do before or after saving the image. Use the CLI when opening a page and saving a file is enough. In either case, distinguish a viewport screenshot from a full-page screenshot explicitly so a reader of the output knows what was captured.

Or skip the browser setup

If you would rather send a URL to a screenshot service than install and operate a browser locally, ScreenshotNeo provides a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP or PDF. For example, this cURL command saves a WebP screenshot of Stripe; replace the URL with the page you need and use your API key:

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 and response details. The same request can be made from Python or Node.js:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

ScreenshotNeo accepts cookie or consent banners as a visitor and removes more than 60 known consent platforms, newsletter popups and chat widgets before capture; each cleanup step can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. Its MCP server includes take_screenshot, get_page_info and capture_pdf for AI agents and MCP clients.

The Free plan includes 1,000 screenshots per month with no card required. Paid plans start at $5 for 3,000 screenshots; every feature is available on every plan. Sign up for ScreenshotNeo’s free plan to try the API without a card.

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

Troubleshoot common capture problems

The screenshot shows only the top of the page

This is expected for a default viewport capture. Run the screenshot command with --full-page when the intended output is the whole scrollable page. If the page loads content only after scrolling, make sure that content has been triggered and check the resulting file.

The screenshot does not match the browser or device you expected

Check which browser and viewport the CLI used, and whether device emulation or high-resolution mode is active. The CLI documents Chrome as its default and also documents other browser choices, headed mode and device emulation. Capture conditions affect the result; select the intended browser and device configuration using the configuration documentation.

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

A section, image or banner is missing

Some content depends on page state, interaction or scrolling. Open the page, carry out the site’s required action, and trigger lazy content before capture. There is no documented universal wait that guarantees all pages are ready, so inspect the output and adjust the page-specific setup.

The file format is not what you wanted

Check the filename extension and the output type in the command. The CLI supports PNG, JPEG and WebP; it uses the extension where available and defaults to PNG otherwise. Consult the screenshot command reference for supported options.

The image is unexpectedly large or its coordinates do not line up

Check whether you requested full-page or high-resolution output. A full-page image can be very tall, while device-pixel scaling can make image coordinates differ from CSS-pixel coordinates. Use the ordinary viewport capture or the appropriate scale when the downstream tool expects different dimensions.

The CLI command is unavailable

Confirm that the global npm installation completed and that the directory where npm installs global executables is on your shell’s PATH. If the installation or browser setup is incomplete, consult the official getting-started guide for the current CLI setup instructions.

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

Choose the right capture workflow

Use the CLI for a quick terminal-driven capture, the Page API when screenshots belong inside repeatable program logic, and a hosted API when you prefer to send a request rather than manage browser capture locally. Whichever route you choose, define the page state, browser, viewport and capture area that the screenshot is supposed to represent; those conditions are part of the result.

Frequently Asked Questions

Can a screenshot prove how a website looks in every browser?

No. It records one rendering under the selected browser, viewport, device settings and page state. Capture separately with the browsers and conditions that matter to your use case.

Can I use a website screenshot as a consistent visual comparison?

Yes, if you keep the capture conditions consistent, including browser, viewport, device scale, URL and any interactions needed to reach the page state.

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.