Updated October 2026 15 min read Head to head

Playwright vs Selenium for Web Scraping (2026)

The costly mistake is rewriting a working scraper to fix blocks that are really a proxy problem. Neither tool changes your IP or solves CAPTCHAs. In Playwright vs Selenium for web scraping, Playwright wins on proxy logins, waiting and traffic control, while Selenium wins on languages and existing code. Here’s what changes if you switch.

PA
ProxyAdvice Editorial Team, Proxy Research Desk
ProxyAdvice · Provider comparisons from published pricing and docs
✓ Sources checked October 30, 2026
Playwright vs Selenium for web scraping in 2026: proxies, waits and migration compared
🤖 Direct answer

Pick Playwright for new scrapers: its docs show a proxy per browser context with an HTTP(S) login, it auto-waits on five checks before each action, and it can block images to save proxy traffic. Keep Selenium if you have working code or need Ruby or Kotlin: it covers six languages in its docs, but shows no proxy login field.

⚡ TL;DR · skip here if you are in a hurry
  • Price: both are free and open source under Apache-2.0. Your real costs are servers, proxy traffic and the hours spent fixing broken runs.
  • Proxies: Playwright sets a proxy per browser context with a login for HTTP(S). Selenium’s options page shows a manual proxy with no username or password.
  • Switching: moving from Selenium means swapping explicit waits for auto-waiting and drivers for contexts. The proxy and parsing logic mostly carries over unchanged.

Playwright vs Selenium for web scraping: which one wins?

Playwright’s GitHub page shows 98.8k stars, almost three times Selenium’s 34.5k, but stars aren’t the reason it wins here.

Playwright
8.6
new scrapers that rotate proxies and load JavaScript-heavy pages
VS
Selenium
7.2
teams with working Selenium code, Ruby users and Grid setups
PlaywrightSelenium
PriceFree, Apache-2.0Free, Apache-2.0
Proxy setupPer browser or per contextManual proxy capability
Proxy loginUsername and password for HTTP(S)Not shown on the options page
WaitingAuto-waits on 5 checksImplicit wait defaults to 0; explicit waits in your code
Network controlRoute, abort, modify responsesNot on the pages read
LanguagesJavaScript, Python, .NET, JavaJava, Python, C#, Ruby, JavaScript, Kotlin
BrowsersChromium, Firefox, WebKitChrome, Edge, Firefox
Driver setupBrowsers installed with the librarySelenium Manager downloads drivers
SessionsIsolated contexts, parallel by defaultRemote WebDriver and Grid
AI agentsOfficial MCP server and CLIThird-party MCP servers, llms.txt
Support and refundsOpen source, nothing to refundOpen source, nothing to refund

Every cell comes from playwright.dev, selenium.dev and each project’s GitHub page, read on October 29, 2026. Neither project publishes benchmarked speed figures.

Playwright takes the rows that cost money in scraping: proxy logins, fewer failed runs from timing, and blocking heavy files so you pay for less proxy traffic. Selenium takes the rows that cost time to change: six languages in its docs, real installed browsers, and years of code you may already have.

New scraper? Playwright. Working Selenium code and no proxy pain? Stay put.

What does each one cost to run?

Both licences cost $0, so the bill you’ll actually see comes from somewhere else.

Playwright and Selenium are both Apache-2.0, per their GitHub pages. What you pay for is the machine that runs the browsers, the proxy traffic each page load uses, and the developer hours spent on runs that fail. That last cost is where the two differ most.

Glossary: headless browser
A real browser running without a visible window. Both tools can run Chromium-based browsers and Firefox this way, which suits servers with no screen.

If you currently use Selenium, switching costs developer time, not money. Expect the migration to take about as many edits as you have waits and locators: each explicit wait can usually go, and each find_element call becomes a Playwright locator. Your parsing code and proxy list carry over as they are.

Servers matter too. If you run browsers on rented machines, see our ranking of VPS for proxy servers before you size them.

The licence is free. Failed runs and wasted proxy gigabytes are not.

How do you set a proxy in Playwright and in Selenium?

Selenium’s options page shows proxy code in four languages, and none of it has a username or password.

Playwright’s network page says a proxy can be set globally for the whole browser or for each browser context. The examples pass server, username and password, and the page says traffic can go through an HTTP(S) proxy or SOCKSv5. The login note covers HTTP(S) only.

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch()
    context = browser.new_context(proxy={
        "server": "http://PROXY_HOST:PROXY_PORT",
        "username": "PROXY_USER",
        "password": "PROXY_PASS",
    })
    page = context.new_page()
    page.goto("https://httpbin.org/ip")
    print(page.text_content("body"))
    browser.close()

Selenium’s options page sets the proxy capability with a manual proxy type. In Python, that’s a Proxy object with httpProxy and sslProxy values. Because no login field appears on the page, the simplest route is to allowlist your server’s IP address in your proxy provider’s dashboard.

from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy, ProxyType

options = webdriver.ChromeOptions()
options.proxy = Proxy({
    "proxyType": ProxyType.MANUAL,
    "httpProxy": "PROXY_HOST:PROXY_PORT",
    "sslProxy": "PROXY_HOST:PROXY_PORT",
})
driver = webdriver.Chrome(options=options)
driver.get("https://httpbin.org/ip")
print(driver.find_element("tag name", "body").text)
driver.quit()
Glossary: IP allowlist
A list of your own server addresses that a proxy provider trusts. Traffic from those addresses connects with no username or password, which suits tools without a login field.

Switching from Selenium means one change here: the proxy moves from the driver’s options into a dictionary on the browser or the context. If you rotate many proxies, give each context its own and keep one browser process running. For the IPs themselves, start from our best residential proxies ranking.

  • Does your provider give you a username and password, or an allowlist?
  • Do you need SOCKS5, and does it need a login?
  • Will you run more than one proxy at the same time?

Why do Selenium scrapers break on slow pages?

Selenium’s default implicit wait is 0, so an element that appears half a second late fails straight away.

Its waits page offers two fixes. An implicit wait is a global setting for every element lookup in the session. An explicit wait is a loop in your code that polls until a condition is true or a timeout raises an error. The page warns not to mix them: a 10-second implicit wait plus a 15-second explicit wait could time out after 20 seconds.

Playwright moves that work into the library. Its auto-waiting page lists five checks: visible, stable, enabled, receives events and editable. A click runs every check except editable, and a fill runs visible, enabled and editable. If the checks don’t pass within the timeout, the action fails with a TimeoutError.

Migration tip
If you currently use WebDriverWait with expected conditions, delete the wait and call the action on a locator. Keep a waiting step only where you need data to load before you read it, such as waiting for a network response.

Selenium waits when you tell it to. Playwright waits unless you tell it not to.

Which one cuts your proxy bill?

Proxy providers bill by the gigabyte, and images, fonts and video are usually the heaviest part of a page.

Playwright’s network page lets you route every request, abort it by resource type, change headers or the method, and fetch then rewrite a response. For a scraper behind a paid proxy, aborting images, media and fonts means those bytes never cross the proxy. The pages read on selenium.dev don’t cover request interception.

from playwright.sync_api import sync_playwright

BLOCK = ("image", "media", "font")

with sync_playwright() as p:
    browser = p.chromium.launch(proxy={"server": "http://PROXY_HOST:PROXY_PORT"})
    page = browser.new_page()
    page.route("**/*", lambda route: route.abort() if route.request.resource_type in BLOCK else route.continue_())
    page.goto("https://example.com")
    print(page.title())
    browser.close()

Isolation matters for bandwidth too. Playwright’s README says each test gets its own browser context with near-zero overhead, and tests run in parallel by default. Selenium scales out with Remote WebDriver and Grid, which run whole browser sessions on other machines.

Blocked by CAPTCHAs instead? Neither tool solves them. Pair either one with one of the best CAPTCHA solvers, or move hard targets to one of the cloud browsers for AI scraping.

The cheapest gigabyte is the one you never download.

What breaks when you switch from Selenium to Playwright?

Very little of your scraping logic breaks; the plumbing around it does.

  1. Map the driver to a contextEach WebDriver session becomes a browser context. One browser can hold many contexts, each with its own cookies and proxy.
  2. Replace find_element with locatorsLocators find elements when you act on them, so stale element errors from Selenium stop being part of your retry code.
  3. Delete explicit waitsAuto-waiting covers visibility, stability and enabled checks. Keep waits only for data that loads after the page, such as an API response.
  4. Move the proxy settingTake the host and port from Selenium’s Proxy object and pass them as server, username and password to the context.
  5. Run both side by sidePoint the old and new scraper at the same pages and proxy for a few days, compare the output, then switch traffic over.

If you currently use Selenium Grid, plan the scaling part separately: Playwright’s parallel runs happen in worker processes and contexts rather than on a Grid hub. If you write Ruby, there’s no Playwright binding on the pages read, so stay with Selenium.

Check SOCKS5 first
Playwright’s docs confirm a login for HTTP(S) proxies only. If your provider gives you SOCKS5 with a username and password, test that before you migrate, or switch to its HTTP(S) endpoint.

Which one works better with AI coding agents?

Only one of the two ships its own MCP server, a standard way for AI agents to call tools.

Playwright’s repository includes an MCP server that gives agents browser control through structured accessibility snapshots, plus a CLI it calls more token-efficient than MCP. Selenium’s AI agents page points agents to an llms.txt index, its docs and examples, and says the MCP servers that exist are community projects, not part of Selenium.

Selenium’s page has one useful warning for migrations driven by an agent: find_element_by methods were removed in 4.3, and executable_path and desired_capabilities were removed in 4.10 for Python. Old tutorials still use them, so tell your agent which version you run.

Playwright and Selenium in detail

1. Playwright: Best for scraping
Best for: new scrapers that rotate proxies and load JavaScript-heavy pages
8.6
Overall
Apache-2.0
Licence
98.8k
GitHub stars
4
Languages

Playwright is the better scraping tool on the pages read. It sets a proxy for the whole browser or for each browser context, with a username and password for HTTP(S) proxies, and it auto-waits on five actionability checks before every action. The weak spot: its docs don’t confirm a login for SOCKS5 proxies, and it has no Ruby binding.

Visit Playwright ↗

Its network page lets you route, abort and rewrite requests. For scraping, that means you can drop images, media and fonts before they download, which cuts the gigabytes you pay a proxy provider for. The GitHub page lists Chromium, Firefox and WebKit on Linux, macOS and Windows, headless or headed.

If you currently use Selenium, the biggest change is the browser context: a separate, cookie-isolated session inside one browser, which the README says has near-zero overhead. One context per proxy replaces one browser per proxy. The repository also ships an MCP server and a CLI for AI agents.

Check before you switch: Does your provider give HTTP(S) proxies with a login? Do you write in JavaScript, Python, .NET or Java? Do your target pages build content with JavaScript? If all three are yes, Playwright fits.

Key facts
  • Apache-2.0 licence, 98.8k GitHub stars
  • Chromium, Firefox and WebKit on Linux, macOS, Windows
  • Proxy per browser or per context, login for HTTP(S)
  • Auto-waits on five actionability checks
  • Route, abort and modify requests; MCP server and CLI
Best for
  • Scrapers that rotate many proxies
  • JavaScript-heavy target sites
  • Teams cutting proxy bandwidth
✓ Pros
  • Proxy per context with HTTP(S) login
  • Auto-waiting removes most manual waits
  • Block images and fonts to save traffic
  • Official MCP server for AI agents
✗ Cons
  • SOCKS5 login not confirmed in the docs
  • No Ruby binding
  • No benchmarked speed figures published
PlanPriceWhat you getProxies
LibraryFree, Apache-2.0JavaScript, Python, .NET, JavaPer browser or per context
Playwright TestFreeParallel by default, tracesPer browser or per context
MCP server and CLIFreeAI agents drive the browserSame proxy settings
GitHub stars
98.8k
Licence
Apache-2.0
Proxy login
HTTP(S)
Editor’s notes · source playwright.dev network and auto-waiting docs, github.com/microsoft/playwright, read on October 29, 2026

The GitHub page showed no release list when read, so the latest version isn’t stated here. The network page says proxies can be HTTP(S) or SOCKSv5 but mentions a login only for HTTP(S).

Verdict: The default pick for new scrapers that rotate proxies.

2. Selenium: Widest language reach
Best for: teams with working Selenium code, Ruby users and Grid setups
7.2
Overall
Apache-2.0
Licence
34.5k
GitHub stars
6
Languages

Selenium is the safer pick when you already have working code or need a language Playwright lacks. Its docs show examples in Java, Python, C#, Ruby, JavaScript and Kotlin, and Selenium Manager downloads drivers on its own. The weak spot: the options page shows proxy code with no username or password, and its default implicit wait is 0.

Visit Selenium ↗

The project calls itself an umbrella of tools built on the W3C WebDriver specification, which drives real installed browsers. Selenium Manager has shipped with every release since 4.6, finds the browser version, downloads the matching driver and caches it. Since 4.11 it can download Chrome too, with Firefox from 4.12 and Edge from 4.14.

The waiting rules are where scrapers break. The waits page says the default implicit wait is 0, so a missing element fails at once. It also warns not to mix implicit and explicit waits, because a 10-second implicit wait with a 15-second explicit wait could time out after 20 seconds.

Check before you stay: Do you have hundreds of lines of working Selenium code? Do you need Ruby or Kotlin? Does your proxy provider support an IP allowlist instead of a login? If two are yes, keeping Selenium is reasonable.

Key facts
  • Apache-2.0 licence, 34.5k GitHub stars
  • Built on the W3C WebDriver specification
  • Docs examples in Java, Python, C#, Ruby, JavaScript, Kotlin
  • Selenium Manager since 4.6, browser downloads since 4.11
  • Implicit wait defaults to 0
Best for
  • Teams with existing Selenium suites
  • Ruby and Kotlin projects
  • Proxies that use an IP allowlist
✓ Pros
  • Six languages in the docs examples
  • Drives real installed browsers
  • Selenium Manager handles drivers
  • Remote WebDriver and Grid for scaling out
✗ Cons
  • No proxy username or password on the options page
  • Manual waits, with a default of 0
  • MCP servers are third-party only
PlanPriceWhat you getProxies
WebDriver bindingsFree, Apache-2.0Java, Python, C#, Ruby, JavaScriptManual proxy capability
Selenium ManagerFree, built inDrivers since 4.6, browsers since 4.11Uses the browser proxy or SE_PROXY
GridFreeRemote and parallel sessionsSet per session
GitHub stars
34.5k
Licence
Apache-2.0
Proxy login
Not shown
Editor’s notes · source selenium.dev options, waits, Selenium Manager and AI agent docs, github.com/SeleniumHQ/selenium, read on October 29, 2026

The options page’s proxy section showed code but no explanatory text when read, so the full list of proxy types isn’t confirmed. The GitHub page listed no releases; the AI agents page uses 4.49.0 as its example version.

Verdict: The pick for existing suites and extra languages, if you handle proxy logins yourself.

Which should you pick for scraping?

Pick Playwright if

  • You’re starting a new scraper.
  • Your proxies use a username and password over HTTP(S).
  • You want to block images and fonts to save proxy traffic.
  • You want auto-waiting instead of hand-written waits.

Pick Selenium if

  • You already have working Selenium code that isn’t failing.
  • You write Ruby or Kotlin.
  • Your proxy provider supports an IP allowlist.
  • You already run Selenium Grid.

Still choosing proxies for either tool? See all proxy rankings, and test your proxies with GoToProxy before you wire them into code.

FAQ

For most new scrapers, yes. Playwright’s docs show a proxy per browser context with an HTTP(S) login, auto-waiting on five checks before each action, and request routing that can block images to save proxy traffic. Selenium is still a good choice if you have working code, write Ruby or Kotlin, or already run Selenium Grid.
Yes. Both are open source under the Apache-2.0 licence, according to their GitHub pages. Neither sells a paid edition on the pages read. Your costs are the servers that run the browsers, the proxy traffic each page uses, and any CAPTCHA service you add. That’s why blocking heavy files matters more than the licence.
The Selenium options page shows proxy code with a manual proxy type and no username or password field. The simplest workaround is to allowlist your server’s IP address in your proxy provider’s dashboard, so the proxy accepts the connection with no login. Playwright, by contrast, takes a username and password for HTTP(S) proxies directly.
Its network page says pages can load over an HTTP(S) proxy or SOCKSv5. The same page mentions a username and password only for HTTP(S) proxies, so SOCKS5 with a login isn’t confirmed there. If your provider offers both, the HTTP(S) endpoint is the safer choice in Playwright.
It depends on how many waits and locators you have. Each WebDriver session becomes a browser context, each find_element becomes a locator, and most explicit waits can be deleted because Playwright auto-waits. Parsing code and proxy lists carry over. Run both versions on the same pages for a few days before you switch.
Neither project publishes a benchmark on the pages read. Playwright’s README says each browser context has near-zero overhead and tests run in parallel by default. In scraping, speed usually comes from fewer failed runs and fewer bytes downloaded, which favours Playwright’s auto-waiting and request blocking.
Playwright’s GitHub page lists Chromium, Firefox and WebKit on Linux, macOS and Windows, headless or headed. Selenium drives installed browsers through WebDriver, and Selenium Manager can download Chrome since 4.11, Firefox since 4.12 and Edge since 4.14. Its README names Chrome, Edge and Firefox for headless mode.
Yes. Playwright’s repository ships an official MCP server and a CLI for coding agents. Selenium’s AI agents page offers an llms.txt index and says MCP servers for Selenium are third-party community projects. It also lists removed APIs, so tell your agent which Selenium version you use.
🔎
How we compared
Last verified: October 29, 2026 · ProxyAdvice · affiliate links marked ↗ may earn a commission

We read Playwright’s network and auto-waiting docs and its GitHub page, and Selenium’s options, waits, Selenium Manager and AI agent docs and its GitHub page, on October 29, 2026. Where a page is silent, the article says so. Nobody here ran a benchmark. Scores weight proxy handling highest. Compare tools with independent proxy ratings on ProxyRates for the proxies you pair them with. Scores are our editorial rating built from published prices, features and terms. They are not lab measurements.

Proxy handling
25%
Waiting and reliability
20%
Network control
15%
Languages and browsers
15%
Setup
15%
Community and agents
10%
Proxy Advice
Logo