Playwright is an open source tool that remote-controls real browsers. Claude Code can install and operate it for you. You need two commands:
pip install playwright
playwright install chromium
From there, tell Claude Code in plain language what you want to automate. It writes the script, opens the browser, and hands you the result. My first run went through without a single error.
Start small. A good first job: "Open my website and take a screenshot."
Sounds trivial, but it is the smoke test for the whole setup. If this works, you have proven that the install is fine, the browser starts, and files arrive. From here you iterate your way to real workflows in minutes.
One detail I use daily: pass a viewport. For narrow image slots I capture pages at 760 pixels wide instead of 1440. Less zoom crop, more readable content.
The real leverage is not the single screenshot. It is the loop: Claude builds something, tests it in a real browser, and fixes what breaks.
My example: the renderer that builds my Instagram slides from HTML. Claude Code wrote it, along with 16 Playwright tests. The tests open real browsers, measure every slide (1080 by 1350 pixels, no overflow), and fail hard when something is off. The review surfaced two real bugs. Claude fixed both on its own. I did not touch a single line.
The underlying point: a test that opens a real browser checks real behavior. No mocks, no assumptions.
Once the basics work, the browser becomes part of your pipeline. In my renderer, the config holds nothing but a URL. During rendering, Playwright opens the page, takes the shot, and places it into the slide.
The website image in my current carousel was created exactly like that: pulled live from e3xler.com at render time, no manual work. No screen photos, no fake mockups.
Browser MCPs exist, and for interactive click sessions they are strong. For pipelines I still went with the script, for one reason: tokens.
An MCP server loads its tool descriptions into the context window, and they ride along on every turn. A Playwright script has none of that overhead. It runs headless in the background, and the result is a file instead of a long chat transcript. For repeatable jobs (rendering, testing, screenshotting) that is the leaner architecture.
No spam, unsubscribe at any time
