Skip to main content
use-apify.com

Puppeteer: guides & tutorials

Control Chrome and Firefox from Node via CDP: fast headless runs, PDF/screenshots, and DevTools-style automation for targeted scraping on Apify.

4 articles

View all tags

Puppeteer controls Chrome and Firefox from Node.js over the DevTools Protocol, giving fast headless automation for screenshots, PDFs, and scraping dynamic pages. These guides cover navigation, waiting for content, and intercepting network requests.

Puppeteer suits targeted Chrome-based scraping, while Playwright adds cross-browser support for broader needs. Pair either with proxies and Crawlee queuing for scale, then deploy as Apify browser actors. Below you will find tutorials and anti-blocking patterns for reliable headless runs.

Related topics

Browser Automation for Web Scraping: Playwright, Puppeteer, and Selenium Deep Dive (2026)

· 7 min read
Yassine El Haddad
Software Developer & Automation Specialist

When simple HTTP requests fail — because content is JavaScript-rendered, login is required, or pagination is AJAX-driven — you need a real browser. Playwright, Puppeteer, and Selenium are the three dominant tools. This deep dive covers when to use each, advanced techniques (network interception, CDP access, fingerprint evasion), and how to run them at scale on Apify.

Playwright vs Puppeteer vs Selenium 2026: 3 Browsers, 1 Winner

· 8 min read
Yassine El Haddad
Software Developer & Automation Specialist
Quick Answer

Default to Playwright for new browser automation: one install drives Chromium, Firefox, and WebKit with built-in auto-wait, ~50–80 MB per context, and Crawlee/Apify integration. Pick Puppeteer 25 for Chrome-only Node services that benefit from raw CDP or the new WebDriver BiDi transport. Keep Selenium 4 when you need Java/C#, Selenium Grid, or BiDi network logging across legacy suites.

In 2026, three tools dominate browser automation: Playwright (Microsoft), Puppeteer 25 (Google, now with WebDriver BiDi), and Selenium 4 (cross-vendor, BiDi-capable). The right choice depends on your use case: new projects should default to Playwright; Puppeteer fits Chrome-focused, lightweight needs; Selenium remains for Java/C# teams and legacy systems. Run Playwright on Apify.

Beginner5 min read

What Is a Headless Browser? Complete Guide for Web Scraping (2026)

· 5 min read
Yassine El Haddad
Software Developer & Automation Specialist

A headless browser is a full web browser (Chromium, Firefox, or WebKit) that runs without a graphical interface. It executes JavaScript, renders HTML/CSS, handles cookies, and behaves exactly like a visible browser — but can be controlled programmatically and runs on servers without a display.

For web scraping, headless browsers are the solution for sites that don't work with simple HTTP requests.

Architecture7 min read

Selenium vs Playwright vs Puppeteer 2026: 35-55 pages/min winner

· 7 min read
Yassine El Haddad
Software Developer & Automation Specialist
Quick Answer

For new scraping projects in 2026, Playwright wins: it runs Chromium, Firefox, and WebKit from one install with built-in auto-wait and trace viewer, hitting ~35–55 pages/min sequentially on static URLs. Puppeteer 25 is a tighter Chrome/Firefox CDP wrapper with WebDriver BiDi support and lower idle RAM. Selenium 4 still leads when WebDriver Grid, Java/C#, or BiDi network logging are non-negotiable.

If you are choosing a driver for web scraping and automation in 2026, the decision is mostly about protocol, waiting model, and browser coverage—not brand loyalty. This guide compares Selenium, Playwright, and Puppeteer feature by feature, sketches realistic performance expectations, shows minimal starter code for each, and ends with Playwright on Apify Crawlee as the default production path.

Quick verdict

Playwright is the best choice for web scraping in 2026 — faster than Selenium, better supported than Puppeteer, with built-in auto-waiting and multi-browser support. Selenium 4 is best for legacy test suites or BiDi-mandated environments.

Use Puppeteer when you are Chrome-only (or Chrome + Firefox via BiDi), Node-only, and want a minimal CDP wrapper. Use Selenium when you must integrate with existing WebDriver-based QA, non-Node stacks, or Selenium Grid that already standardised on WebDriver.

Guides on this site

Frequently asked questions

Frequently Asked Questions

Puppeteer is a Node.js library by Google that controls Chrome or Chromium via the DevTools Protocol. It is used for scraping JavaScript-rendered pages, automated testing, generating PDFs from web pages, and taking screenshots. For scraping, it handles sites where data is loaded dynamically by JavaScript — product pages, social media feeds, and login-protected content.

If starting a new project, Playwright is generally the better choice — it supports multiple browsers, has a more modern API, and is actively maintained by Microsoft. Puppeteer is still a solid option for Chromium-only projects and has a large community. If you already have Puppeteer code running in production, there is no urgent reason to migrate; both tools are production-ready in 2025.

The main challenges: browser memory leaks (restart the browser every N pages), IP blocks (add residential proxies), and rate limiting (add realistic delays between actions). Crawlee wraps Puppeteer with request queuing, session rotation, and automatic retries, solving most production reliability issues. Deploy via Apify to get scheduling, dataset storage, and monitoring without managing your own server.

Puppeteer itself does not solve CAPTCHAs — you need to integrate a third-party CAPTCHA-solving service (like 2captcha or AntiCaptcha) or use an anti-detect browser layer. For most business scraping needs, the better approach is Apify's platform, which manages proxies and browser fingerprinting to minimize how often CAPTCHAs appear in the first place, reducing reliance on CAPTCHA solvers.