What is Playwright?
A Microsoft-maintained library for driving Chrome, Firefox, and WebKit headlessly with a unified API.
Playwright is an open-source automation framework released by Microsoft in 2020. It exposes a single API, available in TypeScript, Python, Java, and .NET, that controls Chromium, Firefox, and WebKit. It replaced Puppeteer at most teams within a year of release thanks to true cross-browser support and built-in waiting primitives that eliminate the flake that plagues Selenium tests.
For scraping, Playwright is the default choice when JavaScript rendering is unavoidable. It exposes network interception, request mocking, and waitForResponse hooks that let a scraper grab JSON from an XHR call directly instead of parsing the rendered DOM.
For testing, Playwright Test is bundled and offers parallel execution, trace viewers, and visual regression. It is the closest thing to a one-stop browser-automation library the JS ecosystem has.
In the wild
await page.goto(url)followed bypage.locator('h1').textContent()- Recording a network HAR while a page loads to inspect every request
- Running a test suite across Chromium, Firefox, and WebKit in parallel