Skip to content

Troubleshooting Beta ​

Common problems and how to fix them.

Connecting fails with 401 ​

Puppeteer reports Unexpected server response: 401, Playwright a failed WebSocket connection. The connect_url was already used, or more than 45 seconds passed since you created the browser. Create a new browser right before you connect, and use each connect_url once.

Creating a browser answers 429 ​

You have 5 browsers running. Browsers you created but never connected to count too, until their connect_url expires after 45 seconds. Close the ones you're done with (browser.close()), cancel unused ones with DELETE /v1/browsers/{id}, and list your sessions with GET /v1/browsers to see what's still running.

Creating a browser answers 404 ​

During the beta, the Hosted Browser is enabled per account. Write to [email protected] to enable it on yours.

The session closes right after connecting ​

The close code says why; see connection close codes. The usual ones:

  • 4001: the exit IP couldn't be located. Try again; with a country, try without one.
  • 4002: the proxy didn't work. With your own proxy, check its address, port and credentials.
  • 4005: no browser free on our side. Wait a few seconds and try again.

None of these are charged.

The session ends in the middle of a script ​

  • Idle time: after 5 minutes without a CDP command from your client, the session ends (limit: idle). If your script waits longer, between steps for example, raise idle_timeout_sec.
  • Session length: 1 hour by default, or your timeout_sec.
  • Traffic: your max_mb, if you set one.

GET /v1/browsers/{id} shows the end_reason.

A site still blocks or challenges the browser ​

  • Don't override the identity. A viewport, a user agent, a time zone or a new incognito context from your code replaces the browser's values with emulated ones. See Stealth.
  • Use premium proxies. Many sites challenge datacenter IPs more often.
  • Reuse an identity if the site expects a returning visitor: see Persistent identity.
  • Turn on humanize if the site watches mouse movement and typing.

Selenium can't connect ​

Selenium doesn't connect to a remote CDP WebSocket URL. Use Puppeteer or Playwright; any other CDP client works too.