What is Playwright?
Playwright is Microsoft's browser automation library. A single API drives Chromium, Firefox and WebKit, with official bindings for JavaScript, Python, .NET and Java. It has auto-waiting, isolated browser contexts, per-context proxy settings and a trace viewer that replays a failed run step by step, which makes it the usual pick for new automation projects.
The object model has three layers. A browser is the process, a context is an isolated profile with its own cookies, storage and permissions, and a page is a tab inside that context. Contexts are cheap, so a script can hold a dozen independent logins at once without launching a dozen browsers. Locators re-resolve the element each time they are used, and every action runs actionability checks first, waiting for the node to be attached, visible and stable before clicking. Most of the sleep calls that pad older automation code disappear.
Playwright takes proxy settings as part of its API. You pass a proxy object with server, username, password and an optional bypass list, either to the launch call or to browser.newContext(). Per-context proxying is the practical advantage, since each context can leave through a different exit IP while keeping its own cookie jar, which maps onto one-identity-per-account work. Combine it with storageState to save and reload a signed-in session, and a run can resume without repeating the login flow.
The bundled Chromium is not branded Chrome, so it lacks proprietary codecs and Widevine, and it reports itself accordingly. Setting channel to 'chrome' or 'msedge' runs the installed stable browser instead, which is closer to what a real user sends. Recent releases run Chromium's newer headless mode, where headless and headful share one binary and behave much more alike. None of that hides automation on its own; navigator.webdriver, timing patterns and IP reputation still feed whatever risk engine is watching.
Operationally, Playwright brings tooling the others make you build. Codegen records a session into working code. The trace viewer stores DOM snapshots, network logs and screenshots for a failed run, which turns flaky-test archaeology into a few clicks. route() intercepts requests, so you can abort images and analytics and cut a crawl's bandwidth substantially. The test runner shards across workers and browsers, and the official Docker image already carries the system libraries that WebKit and Firefox need.
Where you meet it
You reach for Playwright when a scrape needs a real rendering engine, or when a test suite has to prove a flow works in Safari's engine as well as Chrome. The decision it forces early is how to slice identities: one context per account with its own proxy and storage state, or one browser per account. Get that wrong and cookies bleed between accounts, which is how linked-account bans start.
Common questions
Can each Playwright browser context use a different proxy?
Yes. Pass a proxy object to browser.newContext() and that context exits through its own address while sharing the browser process. Each context keeps separate cookies and local storage, so several accounts can run in parallel without leaking state between them. Credentials go in the same object as username and password.
Does Playwright rotate IP addresses by itself?
No. Playwright sets whatever proxy you give it and nothing more. Rotation comes from the proxy side, either by pointing at a rotating endpoint that issues a new address per request or per session, or by assigning a different proxy to each new context in your own code.
Is Playwright better than Selenium for scraping?
For most new work, yes. Auto-waiting removes a large class of race conditions, request interception and proxy credentials are first-class, and one API covers three engines. Selenium keeps the edge where an existing Grid or a commercial device lab already speaks WebDriver, and where the team writes its tests in Java or C#.
Related terms
Real 4G/5G mobile and residential IPs
PROXIES.SX runs carrier IPs in 100+ countries with HTTP and SOCKS5 on every endpoint. $4/GB down to $2.40/GB at volume, free endpoints and rotation, and your GB never expire.