NEWStandard createTask and in.php APIs. Change the address and you are connected.View API docs
GATESOLVER

AI agents and automation

Puppeteer detected as a bot: what to check

When a Puppeteer script starts meeting CAPTCHAs or blank 403 pages, the cause is usually one of a handful of checks. Work through them in this order and you will find most problems in under an hour.

Start with what the page sees

Every investigation should begin inside the page, not in your code. Add a single page.evaluate() right after the first navigation and print the values that detection scripts read. Without this, you are guessing.

const seen = await page.evaluate(() => ({
  webdriver: navigator.webdriver,
  agent: navigator.userAgent,
  langs: navigator.languages,
  zone: Intl.DateTimeFormat().resolvedOptions().timeZone,
  cores: navigator.hardwareConcurrency,
  screen: [screen.width, screen.height, window.devicePixelRatio],
  pluginCount: navigator.plugins.length,
}));
console.table(seen);

Run the same snippet in your everyday browser's console and compare the two outputs side by side. The differences are your list of suspects.

The webdriver flag

Under Puppeteer, navigator.webdriver normally reads true, because Chrome sets it whenever it is under automation control. It is cheap for a site to check and many do. Chrome's --disable-blink-features=AutomationControlled argument has been used to change it; whether it still has that effect depends on your Chrome version, so verify with the snippet above after any change. Avoid crude overrides that replace the property on the navigator object itself, since scripts look for exactly that.

Headless markers

The old headless shell and the newer headless mode behave differently. The old shell announced itself with HeadlessChrome in the User-Agent and lacked parts of the full browser. Recent Puppeteer versions default to the newer mode, which runs the full Chrome without a window. If your project pins an older Puppeteer, or explicitly uses the shell mode, many of the markers return. Check seen.agent for the word "Headless", and check the Puppeteer changelog for the version you have installed.

Other markers come from the server rather than the mode: zero plugins, a single CPU core, a screen exactly the size of the default viewport, and a device pixel ratio of 1 on a page that otherwise claims a laptop. None of these alone proves anything, but together they paint a container.

Launch arguments that hurt

Copy pasted launch configurations often contain flags that make the browser stand out more than they help:

  • --no-sandbox is sometimes required in containers, but run as a non root user so you do not need it.
  • --disable-gpu forces software rendering, which changes WebGL output.
  • A custom --user-agent from a different browser or OS contradicts the engine's own platform values and client hints.
  • --window-size set without a matching viewport produces odd inner and outer dimensions.

Strip the launch arguments back to the minimum, measure, then add back only what you need.

Request patterns

A browser's fingerprint is only half the picture. The other half is what it does over time.

Missing or unusual headers

Puppeteer sends the browser's normal headers, but code that calls page.setExtraHTTPHeaders() can add ones a real browser never sends, or set an Accept-Language that disagrees with navigator.languages. Keep header changes consistent with in page values.

Request interception

Blocking images, fonts and stylesheets saves bandwidth, but some sites notice that their assets were never fetched. If a site starts challenging after you enable interception, try allowing its own first party assets.

Timing and order

Fifty product URLs loaded back to back in a fresh browser every few seconds is a crawler pattern no matter how good the fingerprint is. Pace requests, reuse one browser profile per job, and let cookies build up. The page on rate limiting explains the server side of this.

IP address

Cloud ranges start with low trust on many sites. Running the same script from an office line is a quick test of whether the IP is the main factor.

Fresh profiles every run

puppeteer.launch() without a userDataDir creates a temporary profile and deletes it at the end. Every run is therefore a first visit with no cookies. Give each job a stable profile directory, or save and restore cookies, so the site sees a returning browser. The FAQ entry on saving cookies in Puppeteer covers the code.

When the check is a CAPTCHA by design

Some challenges do not depend on how clean your browser is. Login forms, sign ups and checkouts often show a widget to everyone. In these places Puppeteer pairs naturally with a CAPTCHA solving API: read the site key with page.$eval, send a task, and fill the token into the form. The reCAPTCHA v2 in Node.js guide uses Puppeteer for exactly this, and the Puppeteer integration page lists the other types.

Solving cost depends on the type, for example $0.84 per 1,000 for Turnstile, and only successful solves are charged. A cleaner browser reduces how many you need; it does not replace them where the site requires one.

A troubleshooting order that saves time

CheckHowTypical fix
In page valuesEvaluate the snippet, compare with your desktopAlign locale, timezone, viewport
Headless markerLook for "Headless" in the User-AgentUse the current headless mode or run headed
Launch argumentsRemove all, add back one at a timeDrop flags that change rendering
ProfileIs there a userDataDir?Persist one profile per job
PacingCount page loads per minuteAdd waits, spread jobs over time
NetworkRun once from another connectionBetter IP, sticky sessions
Widget by designDoes a person see it too?Solve it through the API

A note on scope

All of this assumes automation a site would reasonably accept: testing your own pages, checking public prices, archiving public information, or building accessibility tools. Using Puppeteer to create accounts in bulk or to log into accounts that are not yours is outside our terms, and no checklist makes it acceptable.

Checking the TLS and HTTP layer

Because Puppeteer drives a real Chrome, its TLS handshake and HTTP/2 settings normally match Chrome's. Trouble starts when part of the job leaves the browser: a script that logs in with Puppeteer and then fetches pages with a Node HTTP library sends a very different handshake under the same cookies. Sites that compare the two may challenge or reject the second client. Either keep all requests inside the browser (for example with page.evaluate(() => fetch(...))), or accept that the HTTP client needs its own clearance. The TLS fingerprinting entry explains what is compared.

Keep a baseline

Save the output of the in page snippet, your launch options and your Puppeteer and Chrome versions every time a job works well. When detection suddenly increases, diff the current values against the baseline first. More often than not, an automatic browser update or a changed default explains the jump, and pinning or adjusting one setting brings things back. Without a baseline, every incident starts from zero.

Common questions

Why does navigator.webdriver read true in Puppeteer?

Chrome sets it when it runs under automation control. Puppeteer launches Chrome that way, so the flag is on unless the launch changes it.

Does the newer headless mode still show HeadlessChrome?

Generally no, but check your own User-Agent from inside the page, since the default mode depends on your Puppeteer version.

Is blocking images a detection risk?

It can be on some sites. If challenges start after you enable interception, allow the site own assets and compare.

Why do I get a CAPTCHA even with a clean profile?

Many sites show a widget on logins or checkouts to everyone. Those are solved through the API rather than avoided.

Should every run use a new browser profile?

No. A stable profile per job keeps cookies and history, which usually lowers how often you are challenged.

Keep reading