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

For Browserless’s current REST Screenshot API, send a POST request to /screenshot with the page URL and a waitForSelector condition in the JSON body. Browserless waits for the CSS selector before producing the screenshot; set visible: true if the element must be displayed, and handle a non-200 response if the selector times out.

Wait for a selector with Browserless REST

Use the current REST endpoint and shared request configuration. The example waits up to five seconds for an h1, then requests a full-page PNG:

curl -X POST "https://production-sfo.browserless.io/screenshot?token=YOUR_API_TOKEN" 
  -H "Content-Type: application/json" 
  -d '{
    "url": "https://example.com/",
    "waitForSelector": {
      "selector": "h1",
      "timeout": 5000
    },
    "options": {
      "fullPage": true,
      "type": "png"
    }
  }' 
  --output screenshot.png

Replace YOUR_API_TOKEN with your Browserless token and change the URL and selector to match the target page. Browserless documents the current endpoint as POST /screenshot and the selector wait as part of its request configuration. Check the response status before treating the output as an image: a selector timeout produces a non-200 response with an error message.

Wait for presence or visibility

The selector must be valid CSS. By default, the condition can be satisfied by finding the element in the DOM. If the page can insert the element while it remains hidden, require visibility explicitly:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
"waitForSelector": {
  "selector": ".results-ready",
  "visible": true,
  "timeout": 10000
}

The timeout is in milliseconds. Choose a limit appropriate to the page, and make sure your client handles the failure path rather than assuming every response contains a screenshot.

Wait for readiness versus capture one element

waitForSelector is a readiness gate; it does not crop the screenshot to the matched node. If you want the output to show only one element, use the screenshot API’s top-level selector option instead. Browserless waits for that element and captures its bounding box. Use the shared wait condition when a marker means the page is ready but you still want the full page.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Choose a wait condition that matches the page

  • Selector condition: Use when a known element indicates that the content you need has appeared. It ties capture to page state rather than an arbitrary pause.
  • Visibility condition: Add visible: true when DOM presence is insufficient and the element needs to be displayed.
  • Fixed delay: Use waitForTimeout only when the behavior is genuinely time-based and there is no reliable readiness marker. A delay does not confirm that a particular element loaded.
  • Custom page condition: Browserless also documents waitForFunction for waiting on a condition evaluated in the page context.

These are current REST configuration fields. Their exact behavior and availability can change; consult the linked Browserless documentation for the endpoint you use.

Do not mix current REST and legacy BaaS v1 syntax

Browserless’s current REST configuration uses waitForSelector. Its legacy BaaS v1 screenshot page documents a different waitFor property, which can be a CSS selector string, a millisecond number, or a page-context function. These payloads are not interchangeable. Confirm which endpoint generation your account and application call, then use that generation’s documented request shape; the available documentation does not establish which endpoint generations are enabled for a particular account.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

The legacy syntax is documented on Browserless’s BaaS v1 /screenshot API. Do not copy its waitFor example into a current REST request without checking the endpoint.

When you control Puppeteer or Playwright directly

A Browserless REST request is configured through JSON; it is not the same as running local page-control code. With a connected Puppeteer page, explicitly await the selector before taking the screenshot:

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
await page.goto('https://example.com/');
await page.waitForSelector('h1', { timeout: 5000, visible: true });
await page.screenshot({ path: 'screenshot.png', fullPage: true });

Puppeteer documents that waitForSelector returns immediately if the selector already exists and throws if it does not appear within the timeout. Its documented default is 30 seconds; set a shorter or longer explicit timeout when that better fits your task. See the Puppeteer waitForSelector API and Puppeteer screenshots guide.

Playwright also supports Page.waitForSelector, but its current documentation marks that method as discouraged and recommends locator-based waits or web-first assertions for many cases. That advice concerns code controlling a Playwright page directly, not the Browserless REST payload. See Playwright Page documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot missing or failed screenshots

  • Selector timeout: Confirm the selector is valid CSS and matches the rendered page, not just the initial HTML. Increase the millisecond timeout only if the page legitimately needs longer; handle the documented non-200 response when the condition is not met.
  • Element exists but is hidden: Decide whether visibility is part of readiness and set visible: true when it is.
  • Screenshot is cropped unexpectedly—or not at all: A wait condition does not select the output region. Use the screenshot-specific top-level selector when the desired result is an element-only capture.
  • Lazy-loaded content is absent: Browserless’s screenshot documentation suggests scrollPage: true, optionally with options.fullPage: true, to trigger loading by scrolling.
  • Blank page, CAPTCHA, access-denied screen, or missing content: Bot detection may be involved. Browserless points to /unblock for bypassing some bot checks, but does not guarantee it will resolve every site’s blocking.
  • Request fails despite a plausible payload: Check that you are calling the intended API generation and using its matching field names. Current REST uses waitForSelector; legacy BaaS v1 uses waitFor.

Or skip the browser setup

If you just need a screenshot from an API call, ScreenshotNeo accepts a URL and returns an image or PDF. Its API handles cookie banners, popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are not billed. It also provides an MCP server so AI agents can take screenshots.

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 request options. One thousand screenshots a month are free with no card; paid plans start at $5 for 3,000. Sign up for free and get 1,000 screenshots a month with no card.

Frequently Asked Questions

Does Browserless wait for an element to be visible by default?

Not necessarily. Add visible: true when the element must be displayed rather than merely present in the DOM.

Does waitForSelector crop the screenshot to that element?

No. It gates when capture proceeds. Use the screenshot-specific selector option to capture an element’s bounding box.

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.

What happens when the selector never appears?

Browserless documents a non-200 response with an error message. Check the status and handle that failure instead of treating the response as an image.

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.