Connect Playwright to Browserless’s remote Chromium browser, navigate to the page, wait for the content you need, then save it with page.screenshot(). Browserless’s default Chromium WebSocket endpoint speaks Chrome DevTools Protocol (CDP), so the simplest route is Playwright’s chromium.connectOverCDP(). Use a /playwright endpoint with connect() if you need Playwright-native features such as request routing or a browser other than Chromium.
What you need before capturing a screenshot
- A Browserless API token from your account dashboard. Treat it as a secret: Browserless passes it in the WebSocket URL’s
tokenquery parameter. - Playwright installed in your project.
- A target URL and a decision about what counts as ready: a particular selector, a page state, or a short delay for content that appears after navigation.
For JavaScript, Browserless recommends playwright-core for a remote browser because it does not download local browser binaries. For Python, install the Playwright package but do not run playwright install when the browser will run remotely. The browser session runs on Browserless; local browser binaries are not needed for this workflow. See Browserless’s Playwright connection guide.
As an Amazon Associate I earn from qualifying purchases.
Take a full-page screenshot with JavaScript
Install the package:
npm install playwright-core
Set the token in your shell rather than putting a real credential in source code. For example, on macOS or Linux:
export BROWSERLESS_TOKEN="your_browserless_token"
Then save this as an ES module, such as screenshot.mjs:
#1 Best Overall
- 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 { chromium } from 'playwright-core';
const token = process.env.BROWSERLESS_TOKEN;
if (!token) throw new Error('Set BROWSERLESS_TOKEN before running this script');
const browser = await chromium.connectOverCDP(
`wss://production-sfo.browserless.io?token=${encodeURIComponent(token)}`
);
try {
const page = await browser.newPage();
await page.goto('https://example.com', { waitUntil: 'networkidle' });
await page.screenshot({ path: 'screenshot.png', fullPage: true });
} finally {
await browser.close();
}
Run it with node screenshot.mjs. The output is screenshot.png in the current directory. The example uses networkidle as a general readiness condition; on pages with persistent network activity, wait for a specific selector or use a more appropriate page state instead. The finally block closes the remote browser even when navigation or capture throws, releasing the session.
Choose the right Browserless connection endpoint
The connection method should match the protocol spoken by the endpoint. Browserless documents its default Chromium endpoint as CDP, which is why the preceding example uses connectOverCDP(), not connect() against the default endpoint.
| What you need | Connection approach | What to know |
|---|---|---|
| Ordinary Chromium automation and screenshots | chromium.connectOverCDP('wss://production-sfo.browserless.io?token=…') |
Uses Browserless’s default CDP endpoint. Browserless describes CDP as more tolerant of client-version drift than its Playwright-native connection. |
Playwright-native features such as page.route() or APIRequestContext |
chromium.connect() with a path such as /chromium/playwright |
Uses Playwright’s protocol; client and server Playwright versions need to be compatible with the endpoint. |
| Firefox or WebKit automation | firefox.connect() or webkit.connect() with /firefox/playwright or /webkit/playwright |
Use the protocol-specific endpoint path. Check Browserless’s connection URL documentation for endpoint details. |
| Only a URL-to-image capture, without interactive Playwright work | Browserless POST /screenshot REST endpoint |
A WebSocket session is not required; send a URL and capture options and receive image bytes. See the Screenshot API documentation. |
For example, the Chromium Playwright-native endpoint uses the documented /chromium/playwright path. Consult Browserless’s current connection URL and endpoint reference for the correct regional host and protocol path for your account. Do not assume the default CDP endpoint accepts Playwright’s native connect() protocol.
Rank #2
- 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.
Wait for the content the screenshot needs
Navigation finishing does not necessarily mean that the page looks complete. Client-rendered content, image loading, and lazy-loaded sections can require additional readiness handling. Choose a wait condition tied to what the capture must show rather than adding an arbitrary long delay.
- Wait for a key element: after navigation, use
await page.locator('.report-ready').waitFor()or another selector that appears when the target content is present. - Wait for a page state:
page.goto()accepts states such asdomcontentloadedandnetworkidle. A page with persistent network traffic may not reach network idle. - Wait briefly for a known delayed update: use
await page.waitForTimeout(1000)only when a fixed delay is appropriate; it can waste time or still be too short if rendering varies.
For full-page screenshots, lazy-loaded content may not appear until the page is scrolled. Browserless’s REST screenshot API documents a scrollPage: true option to trigger lazy loading before a full-page capture. In Playwright automation, use an explicit readiness strategy that causes the page’s lazy content to load before calling page.screenshot(); verify the target sections are present before capturing.
Capture a viewport, full page, or one element
Viewport screenshot
Omit fullPage to capture the current viewport:
await page.screenshot({ path: 'viewport.png' });
Full-page screenshot
Set fullPage: true to capture the page beyond the visible viewport:
Rank #3
- 【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.
await page.screenshot({ path: 'full-page.png', fullPage: true });
One element
Use a locator’s screenshot method when only a particular element is needed:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
await page.locator('.product-card').screenshot({ path: 'product-card.png' });
For a fixed rectangular region, Playwright also supports a clip rectangle in screenshot options. Browserless’s REST API separately documents selector-based element capture and fixed clipping, along with PNG, JPEG, and WebP output, quality, viewport size, and device scale factor. Use the REST endpoint when those URL-to-image controls are enough and you do not need to interact with the page through a Playwright session.
Python example
Install Playwright without downloading a local browser:
Rank #4
- 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)
python -m pip install playwright
Set BROWSERLESS_TOKEN in the environment, then run:
import asyncio
import os
from playwright.async_api import async_playwright
async def main():
token = os.environ.get("BROWSERLESS_TOKEN")
if not token:
raise RuntimeError("Set BROWSERLESS_TOKEN before running this script")
async with async_playwright() as p:
browser = await p.chromium.connect_over_cdp(
f"wss://production-sfo.browserless.io?token={token}"
)
try:
page = await browser.new_page()
await page.goto("https://example.com", wait_until="networkidle")
await page.screenshot(path="screenshot.png", full_page=True)
finally:
await browser.close()
asyncio.run(main())
Save it as screenshot.py and run python screenshot.py. As in JavaScript, use a selector-based wait if the page continues making requests or if a specific rendered element is the real readiness signal.
Free tools Windows power users keep installed
One-click scans. No signup required.
Keep sessions reliable and credentials private
- Close each browser connection: Browserless counts each parallel browser session against the plan’s concurrency limit. Close sessions in a
finallyblock and bound the number of simultaneous workers. - Do not log the token-bearing URL: the API token is part of the WebSocket URL. Store it in your deployment’s secret or environment-variable mechanism, and avoid printing connection URLs to build logs or public output.
- Do not pass local launch settings as if this were a local browser: remote-browser sessions do not use local
launch()options in the same way. Browserless documents supported launch settings on the connection URL; check its connection guide for the supported parameters. - Account for test parallelism: Browserless recommends a worker-scoped connection fixture for Playwright Test. Each parallel worker opens its own remote session and consumes concurrency.
Browserless describes concurrency behavior qualitatively in its documentation; plan-specific limits depend on the applicable account and plan. Check your account’s current plan details rather than assuming a particular number of simultaneous sessions.
Best Value
- 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
Troubleshooting common screenshot failures
| Symptom | Likely cause | What to do |
|---|---|---|
| Connection fails or times out before a page opens | Missing or invalid token, incorrect endpoint, or an endpoint/protocol mismatch. | Confirm the token is present and current, check the endpoint URL for your account, and match the method to the endpoint: connectOverCDP() for the default CDP endpoint, or connect() for a Playwright protocol endpoint. |
| Playwright reports a protocol or version compatibility error | The native /playwright endpoint and local Playwright client are not compatible. |
Use a supported client/server version pairing for the native endpoint, or use the default CDP endpoint with connectOverCDP() if your work does not need Playwright-native protocol features. |
| The screenshot is blank or misses content | The page has not rendered the needed content, a selector is wrong, or content loads lazily. | Wait for the relevant selector or state, confirm the selector matches an element, and ensure lazy-loaded regions have been triggered before capture. |
networkidle never completes |
The page keeps network connections active or continues background requests. | Use domcontentloaded or another navigation state, then wait for the specific element or content needed for the image. |
| Concurrent jobs are rejected or cannot start | Too many remote sessions are open for the account’s concurrency allowance. | Close sessions promptly, limit parallel workers, and check the applicable plan’s current concurrency limit. |
| Images or lower-page sections are absent from a full-page capture | They load only after scrolling or after a later page event. | Trigger the page behavior that loads them and wait until they are present before capturing. For Browserless REST captures, review the documented scrollPage option. |
Or skip the browser setup
If you need a URL-to-image capture rather than an interactive Playwright session, ScreenshotNeo takes a screenshot from one GET request. See the ScreenshotNeo API documentation for options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners before capture and removes more than 60 known consent platforms, newsletter popups, and chat widgets; each of those steps can be turned off. Bot checks and CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and the response identifies the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up for ScreenshotNeo’s free plan.
Frequently Asked Questions
Can I use Browserless with Playwright Test?
Yes. Browserless recommends creating the remote connection in a worker-scoped fixture; each parallel worker uses a separate session.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Does this workflow require installing Chromium locally?
No. The browser runs remotely on Browserless. Browserless recommends playwright-core for JavaScript connections and skipping playwright install for Python.
Quick Recap
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.




