20 % off all paid plans with code

Comparison · Headless browsers

Puppeteer vs Playwright for Web Scraping

Puppeteer and Playwright are the two libraries most people reach for when a scraper needs a real browser: both start a browser, open pages, run their JavaScript and let you read the result. This comparison of Puppeteer vs Playwright sticks to what the official documentation says – languages, browsers, installation, waiting behaviour and testing – checked on 6 November 2026, with a link for every point.

At the end we look at the question before the choice: for many scraping jobs on large sites you do not need to run a browser at all, because the data is available through an API.

Updated · by everydata.io

What you will have at the end

  • A side-by-side view of Playwright and Puppeteer, with the source for each fact.
  • A minimal scraping example for each library.
  • A rule of thumb for when a browser is the right tool and when an API is simpler.

What you need

  • Basic Python or JavaScript.
  • For the API example at the end: Python 3.10 or newer, the requests package and a free everydata.io API key – create one here.

01Puppeteer vs Playwright: the short answer

Choose Playwright when you want Python, Java or .NET, when you need Firefox and WebKit next to Chromium, or when you want a test runner in the same package. Choose Puppeteer when your project is JavaScript and Chrome or Firefox are enough. For scraping, both do the job; the differences are languages, browsers and tooling.

02Languages: Playwright vs Puppeteer

Playwright: JavaScript/TypeScript, Python, Java and .NET, sharing one implementation (playwright.dev/docs/languages). Puppeteer: a JavaScript library (pptr.dev).

03Browser support

Playwright: Chromium, WebKit and Firefox on Windows, Linux and macOS (playwright.dev/docs/intro); it does not work with the branded Firefox or Safari, it uses its own builds (playwright.dev/docs/browsers). Puppeteer: Chrome or Firefox over the DevTools Protocol or WebDriver BiDi (pptr.dev); stable Firefox since v23.0.0 (pptr.dev/supported-browsers).

04Installation

Playwright for Python: pip install pytest-playwright, then playwright install for the browsers (playwright.dev/python/docs/intro); for Node npm init playwright@latest. Puppeteer: npm i puppeteer downloads a recent Chrome for Testing automatically, about 170 to 280 MB depending on the system; puppeteer-core skips the download (pptr.dev/guides/installation).

05Waiting for elements

Playwright runs actionability checks before every action (visible, stable, receives events, enabled, editable) and auto-waits until they pass (playwright.dev/docs/actionability). Puppeteer's documentation shows a Locator API for finding and acting on elements (pptr.dev).

06Testing

Playwright Test bundles a test runner, assertions, isolation and parallelization (playwright.dev/docs/intro). Puppeteer is a JavaScript library for controlling Chrome or Firefox (pptr.dev).

07Project and license

Playwright's documentation is published by Microsoft, Puppeteer's by Google; both are licensed under Apache-2.0 (github.com/microsoft/playwright, github.com/puppeteer/puppeteer).

08Web scraping with Playwright (Python)

Playwright's synchronous Python API is the quickest way to load a page in a real browser and read it. Swap p.chromium for p.firefox or p.webkit to test the same page in another engine.

playwright_scrape.py
# pip install pytest-playwright && playwright install
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()          # or p.firefox / p.webkit
    page = browser.new_page()
    page.goto("https://example.com")
    print(page.title())
    browser.close()

09Web scraping with Puppeteer (Node.js)

The same task in Puppeteer. Installing the package downloads a compatible Chrome for Testing, so the script runs right after npm i puppeteer.

puppeteer_scrape.mjs
// npm i puppeteer   (downloads a compatible Chrome for Testing)
import puppeteer from "puppeteer";

const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto("https://example.com");
console.log(await page.title());
await browser.close();

10When you don't need Puppeteer or Playwright at all

A headless browser is the right tool for sites you control, for testing, and for pages whose data only appears after scripts run. For product, search and review data from large platforms it is often the expensive route: each page load starts a browser, sites may answer automated traffic with a robot check, and your selectors break with every redesign.

If the site you want is covered by an API, one HTTP request returns the same data as JSON. With everydata.io, for example, an Amazon product page is one call – no browser, no selectors:

api_instead.py
import os

import requests

resp = requests.get(
    "https://api.everydata.io/amz/amazon-lookup-product-by-asin",
    params={"asin": "B07ZPKN6YR", "domainCode": "com"},
    headers={"x-api-key": os.environ["EVERYDATA_API_KEY"]},
    timeout=60,
)
product = resp.json()
print(product["productTitle"], product["price"], product["currency"])
Example response · GET /amz/amazon-lookup-product-by-asin
{
  "responseStatus": "PRODUCT_FOUND_RESPONSE",
  "responseMessage": "Product successfully found!",
  "productTitle": "Apple iPhone 11, 64GB, Black - Unlocked (Renewed)",
  "asin": "B07ZPKN6YR",
  "price": 0,
  "currency": "USD"
}

price is 0 here because the page showed no buyable price for the delivery location – treat it as "no price right now". Answers with a 5xx status are not counted against your quota; the free plan includes 100 requests a month.

A practical split: use Playwright or Puppeteer for your own sites, logins you are allowed to automate and one-off pages; use an API for recurring data from marketplaces such as Amazon, Walmart or YouTube. The full Amazon scraping guide shows the API route step by step.

Endpoints used in this guide

GET/amz/amazon-lookup-product-by-asin

Product Details by ASIN · Amazon API

All parameters in the API reference

Try it with your own data

The free plan includes 100 requests a month, usable on every platform – enough to follow this guide end to end.