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

Glossary

Puppeteer: controlling Chrome from Node.js

Puppeteer is a Node.js library maintained by the Chrome team that controls Chrome or Chromium through the Chrome DevTools Protocol, and in newer versions also Firefox through WebDriver BiDi.

What it does

Puppeteer gives JavaScript code a high level API over a browser: open pages, navigate, click, type, evaluate scripts inside the page, take screenshots, print PDFs and watch network traffic. Installing the main package downloads a compatible browser build, so a fresh project runs without extra setup. A slimmer package, puppeteer-core, skips the download when you bring your own browser.

The core objects

  • Browser: one running Chrome instance.
  • BrowserContext: an isolated profile inside it, with separate cookies.
  • Page: a tab, where almost all work happens.
  • ElementHandle and Locator: references to elements; locators retry until the element is ready.
import puppeteer from "puppeteer";

const chrome = await puppeteer.launch();
const tab = await chrome.newPage();
await tab.setRequestInterception(true);
tab.on("request", (r) =>
  ["image", "font", "media"].includes(r.resourceType()) ? r.abort() : r.continue());
await tab.goto("https://example.com/catalog", { waitUntil: "domcontentloaded" });
const names = await tab.$$eval(".item h3", (els) => els.map((e) => e.textContent.trim()));
console.log(names.length, "items");
await chrome.close();

Blocking heavy resources, as above, is one of the simplest ways to make Puppeteer scraping faster.

Because it speaks CDP

Puppeteer talks to Chrome over the Chrome DevTools Protocol, the same channel the DevTools panel uses. That gives it deep control (network emulation, coverage, performance traces), but enabling certain protocol domains also leaves traces a page script can notice. Combined with navigator.webdriver and headless environment details, this is why bot management products often recognize a default Puppeteer session. Community plugins try to mask some signals; they help on simple checks and lag behind on advanced ones.

Solving a widget from Puppeteer

A practical flow for a reCAPTCHA form you are allowed to automate:

  1. Read data-sitekey and the page URL.
  2. Create a reCAPTCHA v2 task with GateSolver, then poll getTaskResult every three seconds.
  3. Write the gRecaptchaResponse value into #g-recaptcha-response, or pass it to the callback the widget was rendered with.
  4. Submit the form and check the next page loaded.

Expect a token under 9 seconds. If the page instead shows a Cloudflare challenge screen, use a challenge task with the same proxy your browser uses and set the returned cookie and user agent with page.setCookie() and page.setUserAgent(). Tasks that fail are free.

Waiting for the right moment

Many Puppeteer failures come from acting before the page is ready. Prefer page.waitForSelector or a locator over fixed delays, and after submitting a form wait for the navigation or for a response you expect rather than for an arbitrary timeout. When a challenge widget renders late, waiting for its iframe or its data-sitekey element tells you exactly when you can read the key.

When to choose it

Puppeteer is a good fit when your stack is Node.js, you only need Chrome, and you want a small dependency. If you need WebKit, a built in test runner or official bindings in other languages, look at Playwright. For heavier crawling with queues and retries on top of a browser, frameworks such as Crawlee wrap Puppeteer or Playwright for you.

Debug with headless: false and slowMo to watch each step, and see why Puppeteer gets detected for a deeper look at detection.

Common questions

Is Puppeteer only for Chrome?

It is built around Chrome and Chromium, and recent versions also support Firefox through WebDriver BiDi.

What is the difference between puppeteer and puppeteer-core?

The main package downloads a compatible browser on install; puppeteer-core does not and expects you to supply one.

Why do sites detect my Puppeteer script?

Automation flags, DevTools Protocol side effects and headless environment details are all visible to detection scripts.

How do I add a clearance cookie in Puppeteer?

Call page.setCookie with the cookie from the challenge task and setUserAgent with the returned user agent, using the same proxy.

Can Puppeteer make PDFs and screenshots?

Yes. page.pdf and page.screenshot are among its most used features, apart from scraping and testing.

Keep reading