Updated Sep 18, 2026

Discovery

Playwright screenshot, HAR trace, or user script on one URL

Screenshot, HAR trace, or a user script after the page actually renders.

Agent

overview

What playwright does

You have a URL that httpx already marked live, but the useful part is what the browser paints: a login form, a Cloudflare interstitial, or an SPA that stays empty until JavaScript runs. Set --url and leave --mode at screenshot. Chromium, Firefox, or WebKit loads the page, then the node writes screenshot.png, the rendered page.html, and meta.json with status, title, final URL, and elapsed time. That folder is the artifact the next node reads.

Need the network and console too? Switch --mode to trace and the same run also writes network.har, console.log, and a Playwright trace.zip. Need clicks, a login, or a multi-step scrape? Set --mode script and pass --script a JS file that exports a function. The wrapper calls it with page, context, browser, and the output folder. --stealth is on by default and patches navigator.webdriver plus Chromium launch flags. Tune --viewport, --timeout, --user-agent, --locale, and --timezone when the default fingerprint is wrong.

Feed one URL into the playwright node after a liveness probe. Use gowitness or httpx-screenshot when you have a file of hosts and only need pictures. Use httpx when status and headers are enough. Reach for playwright when the next step needs a rendered page, a HAR, or a script you control.

source github.com/microsoft/playwright

use cases

Where playwright fits

Confirm what a live host actually paints

Open --url after a probe and keep a full-page PNG plus rendered HTML so a login wall, SPA, or error page is visible instead of a status line.

Keep a HAR and console for one host

Set --mode trace to store network.har, console.log, and trace.zip next to the screenshot so you can replay what the browser fetched.

Run a bounded browser script

Point --mode script and --script at a JS file that exports a function. The wrapper hands it page, context, and the output folder on the fleet.

Match locale, timezone, and user agent

Set --locale, --timezone, and --user-agent when the page changes by market or blocks a default headless fingerprint.

reference

playwright inputs and flags

12 inputs
NameTypeFlagDescription
urlSTRING--urlTarget URL. Required for screenshot and trace.
modeSTRING--modescreenshot (default), trace, or script.
scriptFILE--scriptUser Playwright JS file. Required when mode is script.
browserSTRING--browserchromium (default), firefox, or webkit.
stealthBOOLEAN--stealthAnti-detection patches and Chromium flags. Default true.
viewportSTRING--viewportViewport as WIDTHxHEIGHT. Default 1280x720.

Showing key inputs. playwright exposes 12 inputs in total.

Full flag reference (12 inputs)
NameTypeFlagDescription
urlSTRING--urlTarget URL to navigate to. Required for screenshot and trace.
modeSTRING--modescreenshot (default), trace (HAR, console, trace.zip), or script (user JS).
scriptFILE--scriptUser Playwright JS file. Only used when mode is script.
browserSTRING--browserchromium (default), firefox, or webkit.
headedBOOLEAN--headedShow a browser window. Default false. Leave off on the fleet.
timeoutSTRING--timeoutNavigation timeout in milliseconds. Default 30000.
viewportSTRING--viewportViewport as WIDTHxHEIGHT. Default 1280x720.
slow_moSTRING--slow-moDelay each action by N milliseconds.
stealthBOOLEAN--stealthPatch navigator.webdriver and set Chromium flags. Default true.
user_agentSTRING--user-agentOverride the User-Agent header. Default is modern Chrome on macOS.
localeSTRING--localeBrowser locale. Default en-US.
timezoneSTRING--timezoneBrowser timezone. Default America/New_York.

example

Run playwright

playwright · command
# screenshot after JS loadplaywright --url https://example.com --mode screenshot --browser chromium # HAR + console + trace.zipplaywright --url https://example.com --mode trace
sample output
{  "mode": "screenshot",  "url": "https://example.com",  "final_url": "https://example.com/",  "status": 200,  "title": "Example Domain",  "elapsed_ms": 842,  "browser": "chromium",  "viewport": { "width": 1280, "height": 720 },  "headed": false,  "error": null}

guidance

Choosing playwright

Use playwright when you need one rendered page, a HAR and trace.zip, or a script you control. Use gowitness when you have a file of hosts and only need Chrome pictures. Use httpx-screenshot when probe metadata and a gallery should stay one step. Use httpx when status and headers are enough.

gowitness

Headless Chrome screenshots from a file of hosts. Faster for bulk visual triage. No Playwright traces, no user scripts, no Firefox or WebKit.

httpx-screenshot

Probes a host list and saves a picture of each live page. Pair when you want status, title, and a gallery in one step.

httpx

Headers, status, title, and tech without a browser. Use it first, then send only the hosts that need a render to playwright.

faq

playwright questions

Set --url and leave --mode at screenshot (the default). The node writes screenshot.png, page.html, and meta.json. Pick --browser if you need Firefox or WebKit instead of Chromium.

Run playwright yourself

A URL feeds the playwright node. The folder holds screenshot.png, page.html, and meta.json, or a HAR and trace.zip when --mode is trace. The JSON sample below is illustrative for example.com, not a fleet run.

Facts on this page come from the live Trickest tool library.