Playwright vs Puppeteer in 2026: Full Comparison

UNDETECTED LABS5 MIN READ
On this page

Google’s Chrome team released Puppeteer in 2017, and for a few years it was the default way to drive headless Chrome from Node.js. In 2020 Microsoft released Playwright, built by several of the engineers who had worked on Puppeteer. Both control a browser from code, but by 2026 they differ in languages, browsers and the tools around them.

Short answer

For a new project, pick Playwright. It has official Python, Java and .NET bindings, drives WebKit as well as Chrome and Firefox, and the strongest open-source stealth tools in my benchmark are built on it.

Stay with Puppeteer if you have a working Node.js codebase on it, or if you want to stay close to the Chrome DevTools Protocol.

The basics

Puppeteer is maintained by Google’s Chrome team. It is a JavaScript and TypeScript library only. It drives Chrome and, since version 23 in 2024, Firefox through WebDriver BiDi.

Playwright is maintained by Microsoft, with official libraries for JavaScript/TypeScript, Python, Java and .NET. It drives Chromium, Firefox and WebKit, the engine behind Safari.

For Python developers this decides it: there is no official Puppeteer for Python. Ports like pyppeteer exist, but they lag far behind.

API comparison

For simple scripts the two look almost the same.

Puppeteer (JavaScript):

const puppeteer = require('puppeteer');

(async () => {
    const browser = await puppeteer.launch({ headless: true });
    const page = await browser.newPage();

    await page.goto('https://example.com');

    // Wait for element manually
    await page.waitForSelector('#login-btn');
    await page.click('#login-btn');

    await browser.close();
})();

Playwright (Python):

import asyncio
from playwright.async_api import async_playwright

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=True)
        page = await browser.new_page()

        await page.goto('https://example.com')

        # Auto-waits for element automatically, no waitForSelector needed
        await page.click('#login-btn')

        await browser.close()

asyncio.run(main())

Playwright (JavaScript):

const { chromium } = require('playwright');

(async () => {
    const browser = await chromium.launch({ headless: true });
    const page = await browser.newPage();

    await page.goto('https://example.com');
    await page.click('#login-btn');  // auto-waits

    await browser.close();
})();

The visible difference is waiting. Playwright’s click() waits for the element on its own. With Puppeteer’s page.click() you call waitForSelector() first, or the click fails if the element isn’t there yet.

Feature by feature

Browsers

Browser Puppeteer Playwright
Chrome Yes Yes
Chromium Yes Yes
Firefox Yes, via WebDriver BiDi (since v23) Yes
WebKit (Safari) No Yes
Edge Yes (Chromium-based) Yes

For scraping this rarely matters, since Chrome opens almost every site. For cross-browser testing it does: Playwright is the one that can test the Safari engine.

Waiting for elements

Before every action (click, fill, hover and so on) Playwright checks that the element is attached, visible, stable, not covered by something else and enabled. It retries until these hold or the timeout runs out.

Puppeteer added a similar locator API, page.locator(), which waits for the element to be visible and enabled before acting. Most Puppeteer code and tutorials still use page.click() and waitForSelector(), though, and they don’t wait this way.

Running pages in parallel

Playwright:

import asyncio
from playwright.async_api import async_playwright

async def scrape(browser, url):
    context = await browser.new_context()
    page = await context.new_page()
    await page.goto(url)
    title = await page.title()
    await context.close()
    return title

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        urls = ['https://example.com', 'https://example.org', 'https://example.net']
        results = await asyncio.gather(*[scrape(browser, url) for url in urls])
        print(results)
        await browser.close()

asyncio.run(main())

Puppeteer:

const puppeteer = require('puppeteer');

async function scrape(browser, url) {
    const page = await browser.newPage();
    await page.goto(url);
    const title = await page.title();
    await page.close();
    return title;
}

(async () => {
    const browser = await puppeteer.launch();
    const urls = ['https://example.com', 'https://example.org', 'https://example.net'];
    const results = await Promise.all(urls.map(url => scrape(browser, url)));
    console.log(results);
    await browser.close();
})();

Both run the three pages at once. The Playwright version gives each page its own context, so they don’t share cookies or storage. The Puppeteer version opens all pages in the default context; to isolate them you’d call browser.createBrowserContext() for each, which Puppeteer also supports.

Request interception

Playwright:

async def block_images(route):
    if route.request.resource_type == 'image':
        await route.abort()
    else:
        await route.continue_()

await page.route('**/*', block_images)

Puppeteer:

await page.setRequestInterception(true);
page.on('request', (request) => {
    if (request.resourceType() === 'image') {
        request.abort();
    } else {
        request.continue();
    }
});

In Puppeteer, setRequestInterception(true) has to come first, and after that every request must be continued, aborted or answered, or the page stalls. In Playwright route() only touches the URLs that match its pattern. More on it in intercepting requests with Playwright.

Stealth

Out of the box both are easy to detect, and Cloudflare, DataDome and similar services block them on many sites.

The open-source stealth tools that did best in my browsers-benchmark run of May 2026 are built on Playwright:

Engine Bypass rate
patchright (Playwright) 100%
camoufox headless (Playwright) 90%
tf-playwright-stealth Firefox (Playwright) 70%
tf-playwright-stealth Chromium (Playwright) 60%

Patchright patches Chrome and the driver. Camoufox is a modified Firefox. tf-playwright-stealth patches only what page scripts can read.

On the Puppeteer side the usual choice is puppeteer-extra-plugin-stealth, which also works at the script level, and the Rebrowser patches fix some driver leaks. The benchmark didn’t include Puppeteer, so I have no numbers to compare them. Full results are in the benchmark write-up.

Documentation and community

Both are well documented. Puppeteer is three years older and has more old answers on Stack Overflow.

GitHub stars in December 2026:

  • Playwright: about 101,700
  • Puppeteer: about 95,900

Setup

Puppeteer:

npm install puppeteer
# Downloads Chrome for Testing automatically

Playwright:

pip install playwright  # or npm install playwright for JS
playwright install chromium  # or playwright install for all browsers

npm install puppeteer downloads a matching Chrome for Testing on its own. Playwright installs browsers in a separate step, which lets you choose which ones.

When Puppeteer still makes sense

You have a Node.js codebase on Puppeteer that works. Rewriting it gains you little unless you need something only Playwright has.

You work close to the DevTools Protocol. Puppeteer is developed by the Chrome team, and raw CDP sessions are a normal part of its API.

Your team writes only JavaScript and knows Puppeteer well.

When to choose Playwright

You write automation in Python, Java or .NET. You need WebKit, or one API across three engines. You want waiting built into every action. Or you plan to use Patchright or Camoufox against bot protection.

For a new project in 2026 I’d start with Playwright. With an existing Puppeteer codebase, switch when you run into something Puppeteer can’t do, not because of this comparison.