Skip to main content

Playwright Cloud Browser

Playwright Cloud Browser for Your Node.js Scripts

Keep browser logic in your Node.js application. Connect over CDP to navigate pages, fill forms and collect results in a temporary remote session.

01 / OVERVIEW

What is Playwright Cloud Browser?

AdsCrawl provides temporary remote browser sessions for Playwright through the Chrome DevTools Protocol (CDP). Create a session with POST /cdp/sessions, then pass the returned cdpBaseUrl to chromium.connectOverCDP. Explicitly release the session when the workflow finishes.

Quick answers

What is the best cloud browser for running Playwright at scale?

Shortlist a cloud browser by connection protocol, concurrency, session lifetime and cost per completed workflow. AdsCrawl fits temporary Chromium workflows that can use chromium.connectOverCDP. If your script needs Firefox, WebKit or Playwright's native browser-server protocol, choose a service that explicitly supports it. Our recorded two-page run proves that workflow, not large-scale throughput.

  1. Run one representative job with the same URLs, proxy region and output checks you will use in production.
  2. Add a queue with bounded concurrency; measure completed jobs, latency, retries and usage before increasing the worker count.
  3. Create a session per independent workflow and delete it in finally, even if a page action or client disconnect fails.

Which headless browser library should I use for scraping with proxies?

Playwright and Puppeteer are both options for a remote Chromium workflow; start with the library your team already uses. Configure the remote browser's proxy through the provider's session API, rather than assuming a local launch setting changes the remote route. AdsCrawl temporary CDP accepts a custom proxy or countryCode, but not both. Country routing is separate from the choice of automation library.

  1. Create one CDP session with the documented proxy or region setting, then connect your chosen client.
  2. Check the browser's exit IP and target page's region-dependent content before collecting a batch.
  3. Test account concurrency and target-site limits; a library or proxy does not guarantee access or a particular success rate.

SEE THE RESULT

Open a page. Click Next. Read the new state.

A recorded Playwright run against an AdsCrawl Remote CDP session: open the JavaScript page, follow its Next link, read page two, then delete the session.

Captured on

items on page one
10
items on page two
10
DELETE HTTP
200
After clicking NextVisit source
Second page of Quotes to Scrape captured after a Playwright click in an AdsCrawl Remote CDP session
Scroll to inspect the full captureOriginal PNG
JSON
{
  "targetUrl": "https://quotes.toscrape.com/js/",
  "startedAt": "2026-11-04T05:58:10.916Z",
  "client": "Playwright",
  "createStatus": 201,
  "steps": [
    {
      "action": "Open JavaScript page",
      "url": "https://quotes.toscrape.com/js/",
      "title": "Quotes to Scrape",
      "quoteCount": 10,
      "firstAuthor": "Albert Einstein"
    },
    {
      "action": "Click Next",
      "url": "https://quotes.toscrape.com/js/page/2/",
      "title": "Quotes to Scrape",
      "quoteCount": 10,
      "firstAuthor": "Marilyn Monroe"
    }
  ],
  "cleanup": {
    "method": "DELETE",
    "status": 200,
    "confirmed": true
  },
  "completedAt": "2026-11-04T05:58:23.692Z"
}

What to check

The URL changes to /js/page/2/ and the first author changes from Albert Einstein to Marilyn Monroe. The run ends with a successful session DELETE response.

Try your own page →

A recorded public-page example. Results reflect the page at capture time and can change with the target website, loading conditions and request settings.

02 / USE CASES

Where it fits

01

Control a complete workflow

Navigate between pages, fill forms and wait for the elements your script needs before reading content. Keep related actions in the same browser session.

02

Separate client and browser

Run the Playwright client from your Node.js service while AdsCrawl runs the remote browser. Your service does not launch a local Chromium process for this connection.

03

Release on success or failure

Use a finally block to call DELETE /cdp/sessions/:sessionId. Treat cleanup as part of your task so failed page actions do not leave the session running.

03 / QUICKSTART

Start with one complete workflow

  1. With ADSCRAWL_API_KEY on your server, POST /cdp/sessions to create a temporary session.
  2. Keep sessionId for cleanup and the returned cdpBaseUrl for Playwright to discover the WebSocket connection.
  3. Pass cdpBaseUrl to chromium.connectOverCDP and run your page actions.
  4. Release the session with DELETE /cdp/sessions/:sessionId, including after errors.

Requires Node.js and Playwright (npm install playwright). Set the ADSCRAWL_API_KEY environment variable on your server first.

Full request and response reference →
Playwright
import { chromium } from "playwright";

const base = "https://api.adscrawl.net";
const headers = {
  "x-api-key": process.env.ADSCRAWL_API_KEY,
  "content-type": "application/json",
};
const res = await fetch(base + "/cdp/sessions", {
  method: "POST", headers,
  body: JSON.stringify({ idleTimeoutMs: 600000 }),
});
if (!res.ok) throw new Error("Create session failed: HTTP " + res.status);
const session = await res.json();
if (typeof session.sessionId !== "string" || !session.sessionId) {
  throw new Error("Create response is missing sessionId");
}
let browser;
try {
  if (typeof session.cdpBaseUrl !== "string" || !session.cdpBaseUrl) {
    throw new Error("Create response is missing cdpBaseUrl");
  }
  browser = await chromium.connectOverCDP(
    session.cdpBaseUrl
  );
  const page = await browser.contexts()[0].newPage();
  await page.goto("https://www.adscrawl.net");
  const title = await page.title();
  // Use title in your application; do not log page content or session URLs.
} finally {
  try {
    await browser?.close();
  } finally {
    const stopped = await fetch(
      base + "/cdp/sessions/" + encodeURIComponent(session.sessionId),
      { method: "DELETE", headers }
    );
    if (!stopped.ok) throw new Error("Session cleanup failed: HTTP " + stopped.status);
  }
}

04 / LIMITS & BILLING

Know the boundaries

Sign up with 500 one-time credits. Hobby is $9/month, Starter $49/month and Pro $199/month. Launching a persistent Cloud Browser requires a paid plan.

Compare plans and allowances →
  • This workflow uses CDP with Chromium. It is not a hosted Firefox or WebKit endpoint.
  • Temporary CDP sessions and reusable Cloud Browser profiles have separate lifecycles. Choose Cloud Browser for a saved profile and interactive viewer.
  • Treat the debugger URL as a credential. Do not publish it or embed your API key in browser-side code.
  • Account concurrency and session timeouts apply. Check failed API responses before using the returned session fields.

Keep API keys on the server. For HTTP 402 check your balance; for 429 reduce concurrency and retry with backoff.

05 / FAQ

Common questions

Is this the same as Playwright's browser-server protocol?

No. This example connects over CDP with chromium.connectOverCDP. Use the documented CDP session interface rather than assuming a Playwright browser-server endpoint.

Will the session become a saved Cloud Browser profile?

No. The session is temporary. Reusable Cloud Browser profiles are managed through a separate API.

Do I need a local browser installation for the connection?

The client connects to the remote browser. It does not launch a local browser; install the Playwright client package required by your application.