Selenium, Puppeteer and Playwright for web scraping

Which browser automation tool holds up at scale? Playwright, Selenium and Puppeteer compared on speed, stability and cost for large web scraping jobs.

Neha Setia Nagpal

12 min read ·

Selenium, Puppeteer and Playwright for web scraping

The short version. Playwright for new work. Puppeteer if Chrome and Node are your only targets. Selenium if you need a browser or a language the other two do not reach. And if the sites you are collecting from defend themselves, the framework you picked is not what decides your success rate.

If you've been in the web scraping game for a while, you've probably heard of Selenium, Puppeteer, and Playwright. These tools are incredibly popular for browser automation, but the question is: are they the best options for web scraping, especially when it comes to scaling?

Let's dig into the details and see what each of these tools offers, along with some of the challenges you might face using them for scraping.

Before we dive into the specifics of each tool, let's get one thing straight: Selenium, Puppeteer, and Playwright weren't built for scraping. They're designed for browser automation, so while they can scrape data, they often struggle when you start scaling up or need to maintain long-term scraping projects.

Why? Well, here are a few reasons:

Scaling gets messy: The more data you want to scrape, the more browser instances you need to run, and that eats up a lot of memory and processing power. If you're scraping hundreds or thousands of pages, this can get expensive really quickly.

Ban detection: Modern websites don't want to be scraped. They've got anti-bot systems in place, and unfortunately, these browser automation tools aren't the best at dodging bans. You'll likely need to stack on extra tools like proxies and CAPTCHA solvers.

Maintenance is a headache: As websites change their structure or add new protections, your scraping scripts need to adapt. This means you'll be spending a lot of time updating and fixing things, which adds to your workload.

They are browser automation libraries, written for driving a browser you control against a site that wants to be tested. Collecting from a site that would rather you did not is a different problem, and none of the three solves the part of it that actually stops you.

What actually differs between the three?

Each tool has its strengths, but they also come with trade-offs. Let's see how they stack up.

Structural properties, not benchmarks. Every row is checked against the project's own documentation and links to it.

Playwright Puppeteer Selenium WebDriver
Browsers it drives Chromium, Firefox, WebKit Chrome or Firefox Chrome, Edge, Firefox, Internet Explorer, Safari
Protocol Chrome DevTools Protocol, and its own for the other engines Chrome DevTools Protocol or WebDriver BiDi The W3C WebDriver standard
Official languages Node.js, Python, Java, .NET Node.js Java, Python, C#, Ruby, JavaScript, Kotlin
Waiting for elements Automatic. It checks visible, stable, receives events, enabled and editable before acting Yours to write Yours to write, or explicit waits
Browser binaries Downloaded separately by playwright install, and pinned to the Playwright version Downloads a matching Chrome build on install Selenium downloads the matching driver for you since 4.6
Age of the API Newest Recent Oldest
Strongest at Driving three engines from one API Chrome-only Node work, leanly Reaching a browser or a language the others do not
Cost of that Largest install, and browsers move when the library moves One engine means one fingerprint An extra process in the chain, and an older API shape

Selenium has been around the longest and is probably the most well-known of the three. It works with all major browsers and can be used with a variety of programming languages, which is great for flexibility.

But here's the downside: Selenium isn't optimized for scraping. It's really more of a general-purpose automation tool. If you're running multiple browser instances, it can get slow and resource-heavy pretty quickly.

Puppeteer is Google's answer to browser automation. It drives Chrome or Firefox over the Chrome DevTools Protocol or WebDriver BiDi, and is known for being fast and efficient. If you're just scraping a few sites, Puppeteer can be a great choice since it's relatively easy to set up and use.

However, it still runs into the same issues as Selenium when you start scaling. You'll need more infrastructure, and dealing with bans will require adding extra tools to your setup.

Playwright is the newest tool in the group, developed by Microsoft. It's got some cool features, like support for multiple browsers (Chromium, Firefox, WebKit) and the ability to handle multiple browser contexts at once, which makes it a bit more powerful.

That said, Playwright still faces the same challenges when it comes to scraping. It's flexible, but once you start scraping at scale, you're going to run into the same infrastructure and maintenance headaches.

A library that waits for an element to be visible, stable, hit-testable, enabled and editable before it acts removes a class of timing failures that you would otherwise handle by hand.

On versions, Playwright states it plainly: "Each version of Playwright needs specific versions of browser binaries to operate", and updating the library means re-running the install command. That coupling is what makes runs reproducible, and it also means you own the upgrade rather than inheriting it from the operating system's browser.

Why does browser automation get hard when you scale it?

Because a browser is a heavy, stateful process. Running one is easy. Running hundreds reliably is an infrastructure problem with five separate parts.

Here's the thing: browser automation tools like Selenium, Puppeteer, and Playwright do the job, but they weren't designed to scrape at scale. Running multiple browsers takes up a lot of resources. As you grow, you'll need to invest in more servers, manage them, and ensure they don't crash or burn out under the load.

Memory. Each browser instance holds a real page in memory, with its own renderer processes. Pages leak and tabs accumulate, so a long-running worker's memory keeps growing. Recycle instances on a schedule rather than waiting for them to fall over.

Crashes. Browsers crash, and at fleet size that stops being an incident and becomes a background rate you design around. Every job has to be resumable, and no state may live only inside a browser process.

Startup cost. Launching a browser takes time, so launching one per page adds that time to every page. The usual answer is to reuse one browser and open a fresh context per job: Playwright's documentation describes contexts as "fast and cheap to create and are completely isolated, even when running in a single browser" (Playwright, browser contexts). That buys speed without giving up cookie and storage isolation between jobs, and it does not protect you from a crash taking the whole browser with it.

Version drift. The library, the driver and the browser all have to stay compatible, and all three move. Pinning versions is the only way to get a reproducible run. Both Playwright and Selenium now manage this for you, in opposite directions: Playwright pins browsers to the library version, and Selenium downloads the driver that matches your installed browser.

Concurrency against the target. How many requests the target will accept from you can bind before the size of your fleet does, and a faster fleet reaches the refusal sooner.

There's also the issue of monitoring and maintenance. With these tools, you'll be spending a lot of time keeping everything running smoothly, especially when websites change or block your scrapers.

What do none of the three do for you?

What you still need Why the framework does not provide it
Address diversity and rotation It does not choose where the request leaves from
Fingerprint consistency A driven browser exposes automation signals unless you suppress them, and suppressing them is not part of any of the three
TCP and TLS characteristics Set below the layer any of them controls
Ban detection and retry policy Yours to build
Session and cookie strategy Yours to build. The libraries give you the mechanism, not the policy
The decision to use a browser at all None of them makes it

This matters more than it used to. The HTTP Archive's 2024 Web Almanac found bot protection services on 33% of desktop sites and 32% of mobile sites, up from 29% and 26% in 2022 (Web Almanac 2024, security chapter). On those sites, the framework you pick is not what decides whether you are served. How anti-bot systems work covers what is being read when a request is refused.

Do you actually need a browser?

Not always, and a browser costs more per page than a plain HTTP request. Two checks before you commit to one.

Look for the data in the HTML the server returned. Fetch the page with a plain HTTP client and search the response for the value you want. If it is there, no rendering is needed and you have removed the whole problem above.

Look for the request the page makes. Open the network tab and watch what the JavaScript calls. Some rendered pages are populated by a request that returns JSON, and calling that directly is faster, simpler to parse and lighter on the site than driving a browser to produce the same result.

Where rendering is genuinely required, render only the pages that require it. A system that decides per page costs less than one that renders everything, and it puts less load on the target.

What are the alternatives to running the browsers yourself?

So, if scaling is your goal, what are your options?

Three, beyond writing it all.

One route is to use API-based scraping where possible. Where a site publishes an API that returns the data you want, you can call it directly and collect nothing. Of course, not every site offers an API, and sometimes they come with limitations.

A second route is to keep the framework and add the missing layers yourself: address rotation, fingerprint handling, ban detection, retry policy and session strategy, built and maintained by you on top of Playwright, Puppeteer or Selenium. This is a real answer for a small number of well understood targets.

Another option is to look into headless scraping tools that combine the power of browser automation with features like proxy management, ban detection, and scaling. These tools are purpose-built for scraping, so they can save you a lot of time and hassle. Zyte API covers access, rendering and retries behind one endpoint, and renders only where the page needs it. Headless browser is the rendering half and unblocking is the access half. Zyte sells that. All three frameworks are free and all three are real answers.

So which one should you choose?

Playwright unless you have a reason not to: three engines, official bindings in four languages, automatic waiting, browsers pinned to the library version.

Puppeteer if you are Chrome-only in Node and want the smallest thing that works.

Selenium if you need a browser or a language the other two do not cover, or you are extending a test suite already built on it.

Then check whether you need a browser at all.

If you're working on small-scale scraping projects, Puppeteer or Playwright can be great options thanks to their speed and flexibility. But for anything more complex or large-scale, be prepared for some serious investment in infrastructure and maintenance.

Browser automation tools can definitely get the job done, but if you want to scrape at scale, you'll need to think about how much time, money, and resources you're willing to put into keeping things running smoothly.

FAQ

Q: Which is best for web scraping: Selenium, Puppeteer or Playwright?
A: Playwright for new work, unless you have a reason not to. It drives Chromium, Firefox and WebKit from one API, has official bindings in Node.js, Python, Java and .NET, and waits for elements automatically. None of the three was built for scraping, and on a defended target the choice between them is not what decides your success rate.

Q: What is the difference between Playwright and Puppeteer?
A: Playwright drives Chromium, Firefox and WebKit, with official bindings in four languages. Puppeteer is a Node.js library that controls Chrome or Firefox over the Chrome DevTools Protocol or WebDriver BiDi. Playwright is broader. Puppeteer is leaner and stays inside Node.

Q: Is Selenium still worth using?
A: Yes, in three cases: you need a browser the other two do not drive, you need one of its six client languages, or you are extending a suite already built on it. Selenium WebDriver implements the W3C WebDriver standard, and since version 4.6 it downloads the matching browser driver for you.

Q: Can these tools get past anti-bot systems?
A: No, not on their own. They drive a browser. None of them chooses the address the request leaves from, manages the request rate, controls the TLS characteristics, or hides the automation signals a driven browser exposes.

Q: Why is browser automation hard to scale?
A: A browser is a heavy, stateful process. Memory use, crashes, startup cost and version drift all compound with fleet size, and the number of requests the target will accept can bind before the size of the fleet does.

Q: Do I need a headless browser for scraping?
A: Not always. If the value is already in the HTML the server returned, a plain HTTP request is faster and cheaper. Fetch the page with a plain client and search the response before you commit to rendering.

Q: What is the cheapest way to collect from JavaScript-heavy sites?
A: Find the request the page's JavaScript makes and call it directly. Some rendered pages are populated by one request that returns JSON. Where that is not available, render, and render only the pages that need it.

Q: How do I stop Playwright and Puppeteer runs breaking after an update?
A: Pin the versions. Playwright ties browser binaries to the library version, so updating the library means re-running its install command. Selenium takes the opposite approach and fetches the driver that matches your installed browser. Either way, a reproducible run means you decide when the upgrade happens.

Try Zyte API

Build your first scraper in minutes

Free trial, no credit card. From a single request to production in an afternoon.

Get started

Neha Setia Nagpal

Developer Advocate & Educator @ Zyte | Storyteller | Women Techmakers Ambassador Neha writes as a developer advocate bridging classic web scraping practice and the AI-agent era. Her articles cover practical tool comparisons (Selenium vs. Puppeteer vs. Playwright, proxy rotation…

More from this author

Continue reading

Group on stage at Extract Summit Dublin 2026
Web data collection

Five takeaways from Extract Summit Dublin

AI is making scraping code cheaper to write. Extract Summit Dublin explored the harder work that remains: access, infrastructure, maintenance and trust.

Robert Andrews
What is a self-healing web scraper?
AI-assisted data extraction

What is a self-healing web scraper?

A self-healing web scraper detects when a site change breaks extraction, repairs the code within limits you set, proves the fix with tests, and escalates when it can't. What it fixes, what it doesn't, how the loop works and what a repair costs.

John Rooney
self-healing-spider-agent
AI-assisted data extraction

Self-healing scrapers: four things to put in place before an AI agent fixes your spiders

What decides whether a self-healing scraper's repair is any good: detection during the crawl, a specific failure report, extraction code the agent can target, and tests that can fail.

John Rooney
12 things I use Zyte MCP for, ranked, with prompts and rules you can copy
AI

12 things I use Zyte MCP for, ranked, with prompts and rules you can copy

What can you use Zyte MCP for? 12 uses, 11 tested, ranked, each with a copy-paste prompt, a CLAUDE.md rule, and a skill idea.

Ayan Pahwa
A shopper faces an overwhelming cascade of ecommerce T-shirt product cards in many colours and configurations, illustrating product-variant explosion.
Web data collection

The trouble with variants: Solving the web's infinite ecommerce explosion

Product variants can turn a straightforward ecommerce scraping project into millions of combinations. Learn how to classify, scope and control them.

Robert Andrews12 min read
How I use Zyte MCP to plan web scrapers
AI

How I use Zyte MCP to plan web scrapers

Zyte MCP lets my AI agent investigate a site before I write the scraper, so I can decide where the data should come from, compare an API with the rendered page for missing fields, and end up with a crawl plan I can act on.

John Rooney

The Community · Newsletter

The best of Zyte and the data web, in your inbox.

One curated edition — new articles, product updates, and the stories shaping the data web. No noise.