Every scraping or testing project hits the same fork early: Playwright, Selenium or Puppeteer? Forum threads pick a side, then argue for pages.
We skipped the arguing. We ran the same 10-page job in all three, on the same machine and the same Chrome build, and measured run time, memory and lines of code. Then we fed each one a page that loads its content late, which is where the real differences show up.
Here’s what we found, and which one to pick for your project.
Playwright vs Selenium vs Puppeteer at a glance
All three drive a real browser from code. They click, type, scroll and read pages the way a person would, which is why they’re used for both testing and scraping. The differences are in who built them, which browsers and languages they cover, and how much they do for you.
| Playwright | Selenium | Puppeteer | |
|---|---|---|---|
| Made by | Microsoft (2020) | Open-source project (2004) | Google Chrome team (2017) |
| Languages | JS/TS, Python, Java, .NET | Java, Python, C#, Ruby, JS, Kotlin | JavaScript |
| Browsers | Chromium, Firefox, WebKit | Chrome, Firefox, Edge, Safari | Chrome, Firefox |
| How it talks to the browser | Browser protocols directly | W3C WebDriver | DevTools Protocol (and WebDriver BiDi) |
| Waits for elements | Automatically | You add waits | You add waits |
| Built-in test runner | Yes | No | No |
| Best for | New test suites and scrapers | Enterprise and real Safari | Lean Chrome scripts |
The test: same job, three tools
We wrote the same script three times. Each one opens Chrome headless, visits catalogue pages 1 to 10 of books.toscrape.com (a practice site built for scraping), and pulls the title and price of every book. All three returned the same 200 books, starting with “A Light in the Attic” at £51.77.
To keep it fair, every tool used the same Chrome 156 binary. We ran each script three times against the live site, then five times against a local copy of the same 10 pages, so network speed couldn’t hide the tool’s own overhead.
| Setting | Value |
|---|---|
| Job | Catalogue pages 1 to 10, title and price of 200 books |
| Browser | Google Chrome 156, headless, same binary for all |
| Versions | Playwright 1.65.1, Puppeteer (core) 25.18.1, Selenium WebDriver 4.54.0 |
| Runtime | Node.js 24 on Linux |
| Runs | 3 against the live site, 5 against a local copy |
| Measured | Wall time, peak memory of all processes, non-blank lines of code |
Here’s the Playwright version. The other two have the same shape.
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ executablePath: '/usr/bin/google-chrome', headless: true });
const page = await browser.newPage();
const books = [];
for (let i = 1; i <= 10; i++) {
await page.goto(`https://books.toscrape.com/catalogue/page-${i}.html`);
const rows = await page.locator('article.product_pod').evaluateAll(els =>
els.map(e => [e.querySelector('h3 a').title, e.querySelector('.price_color').textContent]));
books.push(...rows);
}
console.log(books.length, books[0]);
await browser.close();
})();
Speed: closer than the forums say
Against the live site, the medians were Selenium 14.6 seconds, Puppeteer 16.6 and Playwright 16.7. That looks like a Selenium win until you see the spread: Selenium’s three runs took 17.2, 14.6 and 8.2 seconds. The network was doing almost all the work, and its mood changed between runs.
The local copy gave the honest picture.
| Tool | Full run (median) | Launch | 10 pages | Peak memory | Lines of code |
|---|---|---|---|---|---|
| Selenium | 0.82 s | 0.35 s | 0.34 s | 1,102 MB | 18 |
| Puppeteer | 0.87 s | 0.28 s | 0.39 s | 1,080 MB | 14 |
| Playwright | 1.04 s | 0.25 s | 0.52 s | 1,155 MB | 14 |
On the full run, Selenium (0.82 s) and Puppeteer (0.87 s) beat Playwright (1.04 s). Splitting launch from scraping showed where the time went. Playwright launched Chrome fastest, then spent longer on the ten pages, because its locators run extra checks before they act. Selenium was slowest to start, since it launches ChromeDriver first, then scraped fastest.
The gap is about two tenths of a second on a 10-page job. On a real site, one slow server response costs more than that. If someone picks a tool for raw speed alone, they’re optimising the wrong thing.

Memory: all three run a full Chrome
Peak memory, summed across the script and every Chrome process it started, landed close together:
- Puppeteer: 1,080 MB
- Selenium: 1,102 MB
- Playwright: 1,155 MB
That summed figure overcounts memory that Chrome processes share, so read it as a comparison, not a real bill. The point stands either way: the browser is the heavy part, not the library. If you need to run 20 browsers at once, plan your server around Chrome, whichever tool drives it.
Lines of code: a near tie
Our Playwright and Puppeteer scripts were 14 non-blank lines each. Selenium needed 18, mostly for building the Chrome options object and a try/finally to make sure the driver quits.
The bigger difference is how the code reads. Puppeteer and Playwright both talk to Chrome directly over its debugging protocol, so they feel similar. Selenium goes through the W3C WebDriver standard, which is a little more formal and a lot more portable.
The late-loading test: where they really differ
Fast static pages are the easy case. Modern sites load content with JavaScript after the page arrives, and that’s where scripts break.
We built a page that shows a price 800 milliseconds after it loads, then asked each tool to read it with its most natural one-liner.
| Tool | Natural one-liner | Result | With a wait added |
|---|---|---|---|
| Playwright | locator(‘.price’).textContent() | Read £19.99 after 808 ms | Not needed |
| Puppeteer | page.$(‘.price’) | Returned null | waitForSelector: found in 795 ms |
| Selenium | findElement(By.css(‘.price’)) | NoSuchElementError | 3 s implicit wait: found in 836 ms |
Playwright read the price on the first try, after waiting 808 ms on its own. Its locators retry until the element appears or a timeout passes.
Puppeteer returned nothing, because page.$() checks once and moves on. Adding waitForSelector fixed it in 795 ms.
Selenium threw a NoSuchElementError. With an implicit wait of three seconds it found the price in 836 ms.
All three can handle late content. The difference is whether you have to remember to ask. In a large test suite or a scraper that hits many sites, forgotten waits are the top cause of flaky runs, and Playwright removes most of them by default.

Five pages at once: parallel runs
One browser tab at a time is rarely how real jobs run. We gave each tool a queue of pages and five workers, the way you’d scale a scraper or split a test suite.
Playwright and Puppeteer ran their five workers as browser contexts inside one Chrome. Each context is a separate session with its own cookies, but they share one browser process. Selenium has no contexts, so its five workers meant five separate Chrome instances, each with its own ChromeDriver.
We ran it twice: 20 pages from the live practice site (three rounds), and 50 pages from our local copy (five runs each).
| Tool | How workers run | Live, 1 worker | Live, 5 workers | Local, 5 workers: peak memory |
|---|---|---|---|---|
| Playwright | 5 contexts, 1 Chrome | 15.1 s | 6.5 s | 2,541 MB |
| Puppeteer | 5 contexts, 1 Chrome | 14.8 s | 8.3 s | 1,794 MB |
| Selenium | 5 Chrome instances | 16.3 s | 6.3 s | 5,166 MB |
On the live site, five workers cut the job from about 15 seconds to 6-8 seconds in all three tools. Selenium was the fastest parallel runner at 6.3 seconds, because five full browsers don’t compete for one process’s attention.
The memory column tells the other half. Selenium’s five browsers peaked at 5,166 MB, against 2,541 MB for Playwright and 1,794 MB for Puppeteer. On a 4 GB cloud server, Selenium’s approach runs out of room long before the others.
The local run also had a lesson of its own. With pages served instantly, five workers were slower than one in every tool, since the CPU, not the network, was the limit. Parallel workers only pay off when you’re waiting on slow servers. Before you add workers, check what you’re actually waiting for.
Blocking images and CSS: the easy speed win
A scraper reading titles and prices doesn’t need product photos or stylesheets. Skipping them is often the single biggest speed-up, bigger than any choice between the three tools.
We loaded three catalogue pages from the live site with and without blocking images, stylesheets and fonts:
| Tool | Normal load | Images, CSS and fonts blocked | Requests |
|---|---|---|---|
| Playwright | 5.9 s, 736 KB | 3.1 s, 224 KB | 90 → 18 |
| Puppeteer | 11.4 s | 3.8 s | 92 → 20 |
| Selenium (Chrome DevTools) | 3.3 s, 204 KB on last page | 0 of 20 images loaded | Chromium only |
Playwright did it in one line with page.route():
await page.route('**/*', route =>
['image', 'stylesheet', 'font'].includes(route.request().resourceType())
? route.abort()
: route.continue());
Transfer dropped from 736 KB to 224 KB and the run took about half as long. Puppeteer’s setRequestInterception did the same job with a few more lines.
Selenium has no built-in route API, but on Chrome it can pass DevTools commands through. We used Network.setBlockedURLs with patterns for images, CSS and fonts, and 0 of the page’s 20 images loaded, against 204 KB transferred without the block. That route only works on Chromium browsers, so a cross-browser Selenium suite can’t count on it.
One warning before you block everything: some sites check that a page loaded like a real browser. Blocking CSS can also hide elements your selectors depend on, if the site uses CSS to reveal them. Test on the target site, then keep the block.
Screenshots and PDFs
All three can save a screenshot and print a page to PDF. The details differ more than you’d expect.
| Tool | Full-page screenshot | Our capture | PDF time |
|---|---|---|---|
| Playwright | Yes, fullPage: true | 1280 × 4541 px, 217 ms | 84 ms |
| Puppeteer | Yes, fullPage: true | 800 × 4559 px, 175 ms | 75 ms |
| Selenium (Chrome) | No, visible window only | 780 × 493 px, 69 ms | 52 ms |
The surprise was Selenium’s screenshot. With Chrome, takeScreenshot() captured only the visible window, 780 by 493 pixels, while Playwright and Puppeteer saved the whole 4,500-pixel-tall page with fullPage: true. If you need full-page captures from Selenium on Chrome, you have to resize the window to the page height first or stitch shots together.
Puppeteer’s capture was narrower because its default viewport is 800 by 600. Playwright defaults to 1280 by 720. Set the viewport yourself in either tool if the width matters.
PDF output was quick everywhere, between 52 and 84 milliseconds for a short page. Selenium’s printPage() is part of the WebDriver standard, so it works across browsers, which the other two can’t fully promise for PDF.
When a selector is wrong: how each tool fails
Scripts break, and how they break decides how long you spend fixing them. We misspelled one class name, .price-colour instead of .price_color, and timed each tool’s reaction.
| Tool | Call | What happened | Time to fail |
|---|---|---|---|
| Playwright | locator().textContent() | Timeout error naming the locator | 5,000 ms (our timeout; default 30 s) |
| Puppeteer | page.$() | Returned null, no error | 12 ms, silently |
| Puppeteer | waitForSelector() | Timeout error naming the selector | 5,001 ms |
| Selenium | findElement() | NoSuchElementError with the selector | 9 ms |
This is the flip side of auto-waiting. Playwright waited the full timeout before failing, because it can’t tell a typo from a slow page. Its default is 30 seconds, so a suite with ten broken selectors can burn five minutes just waiting. Its error names the locator and the timeout, which makes the cause easy to spot.
Puppeteer’s page.$() returned null in 12 ms and kept going. No error, no warning. The script only breaks later, when something tries to read text from null, which hides the real cause several lines away.
Selenium failed in 9 ms with a NoSuchElementError that printed the exact selector. For debugging, that’s the clearest of the three, as long as the page had finished loading.
So which is better? For tests, set Playwright’s timeout to something sensible, like 5 to 10 seconds, and you get both safety and speed. For scrapers, make Puppeteer’s empty results an error yourself, so a site redesign shows up as a failure instead of a blank spreadsheet.
Playwright: the modern default
Microsoft released Playwright in 2020, built by engineers who had worked on Puppeteer at Google. It drives Chromium, Firefox and WebKit (Safari’s engine) with one API, and it has official libraries for JavaScript and TypeScript, Python, Java and .NET.
What you get on top of browser control:
- Auto-waiting locators, as our late-loading test showed.
- A test runner with parallel workers, retries and reports.
- Trace viewer, which records every step with screenshots and network calls, so you can replay a failed run.
- Codegen, which writes a script while you click through a site.
- Browser contexts, isolated sessions that share one browser, which makes running many logged-in users cheap.
The trade-off is size. Playwright downloads its own browser builds by default, and it does more checking per action, which cost it a few tenths of a second in our run.
Pick Playwright if you’re starting a new testing or scraping project, need Safari coverage, or want fewer flaky runs.
Selenium: the standard with the widest reach
Selenium has been around since 2004 and is the reference implementation of W3C WebDriver, the official standard for controlling browsers. Every major browser ships a driver for it, including Safari and Edge.
Its strengths are breadth and ecosystem:
- Languages: Java, Python, C#, Ruby, JavaScript and Kotlin.
- Browsers: Chrome, Firefox, Edge and Safari, including real Safari on macOS.
- Selenium Grid, for spreading tests across many machines and browser versions.
- Cloud testing support, since nearly every cross-browser testing service speaks WebDriver.
Selenium 4 also manages drivers for you through Selenium Manager. In our test it downloaded a matching ChromeDriver on the first run without any setup, which removed the old “driver version mismatch” headache.
The weak spots are boilerplate and waiting. You manage waits yourself, and features like network interception are newer and less polished than in the other two.
Pick Selenium if your team works in Java, C# or Ruby, you need real Safari or old browser versions, or you already run a Selenium Grid or a cloud testing account. Our list of cross browser testing tools covers services that run Selenium at scale.
Puppeteer: lean and close to Chrome
Google’s Chrome team released Puppeteer in 2017. It’s a JavaScript library that talks to Chrome over the DevTools Protocol, and newer versions can drive Firefox too.
It’s the lightest of the three. Install puppeteer-core, point it at a browser and you’re working. It had the lowest memory figure in our test and the quickest scrape after Selenium.
Where it fits best:
- Chrome-only scraping and automation scripts in Node.js.
- PDFs and screenshots of web pages, which it does well with very little code.
- Low-level Chrome control, such as performance tracing and request interception.
It’s not a testing framework. There’s no runner, no trace viewer and no auto-waiting, and official support is JavaScript only.
Pick Puppeteer if you write Node.js, only need Chrome, and want a small library for a scraper, PDF service or internal tool.
Install size and setup
Disk space and setup time matter more than you’d think on CI servers and small VPS plans. Here’s what each package added to our project with npm:
| Package | Size in node_modules | Downloads a browser? |
|---|---|---|
| playwright 1.65.1 | 19 MB (with playwright-core) | Yes by default, 676 MB for Chromium alone |
| puppeteer-core 25.18.1 | 8.7 MB | No (the puppeteer package does) |
| selenium-webdriver 4.54.0 | 24 MB | No; fetches a matching driver |
The numbers hide one big difference. Playwright’s default install also downloads its own browsers: on our machine, its Chromium build took 403 MB and the separate headless shell another 273 MB. Add Firefox and WebKit and you’re past 1 GB. You can skip that and point it at an installed Chrome, as we did, with executablePath.
Puppeteer has two packages. puppeteer downloads a matching Chrome for Testing on install; puppeteer-core downloads nothing and expects you to supply the browser. We used the core package.
Selenium’s package was the largest at 24 MB, mostly because it bundles support for every browser and Selenium Manager. On first run, Selenium Manager fetched a ChromeDriver that matched our Chrome 156 without any manual step.
In Docker, all three need the same system libraries that Chrome needs. Playwright’s npx playwright install-deps and its official Docker images handle that for you, which saves the usual hour of chasing missing .so files.
Which one should you use for web scraping?
For most new scrapers, Playwright. Auto-waiting saves hours on JavaScript-heavy sites, browser contexts make it cheap to run many sessions, and the Python version is as complete as the JavaScript one.
Choose Puppeteer for a small Chrome-only Node.js scraper where you want the lightest setup.
Whichever you pick, the tool isn’t what gets you blocked. Sites look at your IP address, request rate and browser fingerprint. Our guide to rotating proxies in Python shows how to spread requests across many addresses, and the roundup of anti-detect browsers covers fingerprint control for multi-account work.
If you’d rather not write and maintain scripts at all, our explainer on browser automation vs web scraping helps you decide whether you need a browser in the first place.
Heads-up: our Browse AI and Bright Data links are affiliate links. If you buy through them, DroidCrunch earns a commission at no extra cost to you.
Two shortcuts worth knowing. Browse AI lets you train a scraping robot by clicking on a page, with no code, which suits simple monitoring jobs. Bright Data offers a hosted Scraping Browser that you connect to with Playwright, Puppeteer or Selenium, with proxies and CAPTCHA handling built in. For more options, see our list of the best web scraping tools.
Which one should you use for testing?
For new end-to-end test suites, Playwright is the strongest pick. The runner, parallel workers, traces and auto-waiting are all included, and it covers WebKit for Safari-style checks.
Selenium is the right call when testing has to match what enterprise teams already run: Java or C# codebases, real Safari, older browser versions or a big cloud device grid.
Puppeteer is rarely the best choice for test suites today, unless you only test Chrome and already have tooling built around it.
The same commands in each tool
If you’re switching tools or reading someone else’s code, this map covers the calls you’ll use most. All three are the Node.js versions we tested.
| Task | Playwright | Puppeteer | Selenium |
|---|---|---|---|
| Open a page | page.goto(url) | page.goto(url) | driver.get(url) |
| Find one element | page.locator(css) | page.$(css) | driver.findElement(By.css(css)) |
| Find many | locator.all() | page.$$(css) | driver.findElements(...) |
| Wait for it | Automatic | page.waitForSelector(css) | driver.wait(until.elementLocated(...)) |
| Click | locator.click() | page.click(css) | element.click() |
| Type | locator.fill(text) | page.type(css, text) | element.sendKeys(text) |
| Run page JavaScript | page.evaluate(fn) | page.evaluate(fn) | driver.executeScript(fn) |
| New isolated session | browser.newContext() | browser.createBrowserContext() | A new driver |
| Screenshot | page.screenshot() | page.screenshot() | driver.takeScreenshot() |
The pattern is clear once you see it side by side. Playwright and Puppeteer share most of their vocabulary, so moving between them takes an afternoon. Moving from Selenium is a bigger rewrite, mostly because waits change from something you add to something the tool does.
Common problems and how to fix them
These came up while we built the tests, or they’re the errors you’ll meet first in each tool:
| Problem | Usual cause | Fix |
|---|---|---|
| Selenium: driver version mismatch | Old ChromeDriver on the PATH | Remove it and let Selenium Manager fetch a match |
| Puppeteer: empty results, no error | page.$() ran before content loaded | Use waitForSelector or check for null |
| Playwright: tests hang 30 s, then fail | Wrong selector meets auto-wait | Lower the timeout; check the locator in codegen |
| Any tool: Chrome won’t start in Docker | Missing system libraries or sandbox | Use an official image or install Chrome’s dependencies |
| Any tool: blocked or CAPTCHA pages | IP reputation, request rate, fingerprint | Slow down, rotate proxies, use a real browser profile |
| Leftover Chrome processes | Script crashed before closing | Close the browser in a finally block |
| Memory climbs during long runs | Pages and contexts never closed | Close each context when its job ends |
Frequently asked questions
Is Playwright better than Selenium?
For most new projects, yes. Playwright waits for elements automatically, ships a test runner and trace viewer, and covers WebKit. Selenium is still better for Java, C# or Ruby teams, real Safari, older browsers and existing Selenium Grid or cloud testing setups.
Is Puppeteer faster than Playwright?
Slightly, in our test. Puppeteer finished our local 10-page job in 0.87 seconds against Playwright’s 1.04. The gap came from Playwright’s extra checks per action. On a real website, network delays are far larger than that difference.
Can Playwright replace Selenium?
For many teams, yes. Playwright covers modern Chromium, Firefox and WebKit with one API. It can’t drive real Safari on macOS or older browser versions, and it doesn’t plug into WebDriver grids, so some enterprise suites still need Selenium.
Which is best for web scraping: Playwright, Selenium or Puppeteer?
Playwright, for most scrapers. Its auto-waiting handles JavaScript-heavy pages and browser contexts make many sessions cheap. Puppeteer suits small Chrome-only Node.js scrapers. Selenium works but needs more code for waits. Proxies matter more than the tool for avoiding blocks.
Does Playwright work with Python?
Yes. Playwright has an official Python library with the same features as the JavaScript version, including auto-waiting, browser contexts and a pytest plugin for testing. Puppeteer is JavaScript only, though an unofficial Python port called Pyppeteer exists and is no longer actively maintained.
Which uses less memory: Playwright, Selenium or Puppeteer?
They’re close, because each one runs a full Chrome. In our test, peak memory across all processes was 1,080 MB for Puppeteer, 1,102 MB for Selenium and 1,155 MB for Playwright. Plan server capacity around the browser, not the library you choose.
Is Selenium still worth learning?
Yes, if you work in QA or enterprise development. Selenium is the W3C WebDriver standard, it’s in countless existing test suites and most cloud testing services support it. For personal scraping or a brand-new test suite, Playwright is the quicker start.
The bottom line
In our 10-page test, all three tools finished within a quarter second of each other and used about the same memory, because Chrome does the heavy lifting. Speed shouldn’t decide this. Scale changes the maths, though: five parallel Selenium browsers peaked at 5.2 GB, about twice what Playwright’s five contexts needed.
What should decide it: Playwright for most new projects, thanks to auto-waiting, its test tooling and three browser engines. Selenium when you need its languages, real Safari or an existing grid. Puppeteer for lean Chrome-only Node.js scripts.
Start with one small script in your pick. If it reads a late-loading page without extra waits, you’ll feel why Playwright has become the default.



