All tools

Playwright

Browser automation library for tests, screenshots and scripted capture

My rating4.5
Free, open source under the Apache 2.0 licenceOpen source
Verdict

The browser automation that finally stopped being flaky, and the network capture is the hidden feature.

Pros

  • One API drives Chromium, Firefox and WebKit
  • Auto-waiting kills most of the flakiness older tools had
  • Records every network request, so you can see the API behind a web app
  • Codegen writes the first draft of a script by watching you click

Cons

  • Browser downloads are large and break when versions drift between machines
  • Headless runs still get blocked by some bot detection
  • The Python bindings lag the Node ones on new features

Best forDevelopers who need a real browser in a script: to test a site, screenshot a page or watch what a web app calls.

Playwright drives a real browser from code. Open a page, click, type, wait for something to appear, take a screenshot, read what the page requested over the network. It comes from Microsoft, it is free, and it works in Node, Python and a few other languages.

How I use it

Three jobs. The first is screenshots: a script opens a list of landing pages at phone and desktop widths and saves an image of each, so I can compare twenty pages in a folder instead of twenty tabs. The second is testing my own sites before a deploy: open every route, check for the strings that must be there, fail if one is missing. The third is the one people overlook. Playwright records every network request a page makes, so when a web app has no public API, I let the browser log in and click around, read the calls it makes, and then write a script that makes those calls directly. That has turned more than one tedious web interface into a few lines of Python.

What surprised me is how much less flaky it is than the tools before it. Waiting is built in, so a click on an element that has not rendered yet waits instead of failing. Codegen, which records your clicks into a script, is a good first draft generator. What annoys me is the browser binaries: they are large, they must match the library version, and a machine where the two drift apart fails with an unhelpful error. Some sites with bot detection also refuse headless browsers, and the workarounds are fragile. The Python bindings get new features a little later than the Node ones.

Who it is for

Any developer who needs a browser in a script. If you write end-to-end tests, this is the current best choice. If you only need to fetch HTML, a plain HTTP client is lighter and you should use that instead. Skip it if your target site actively fights automation; you will spend your time on evasion rather than the task.

Alternatives

PuppeteerSelenium