MerchantryTidbits

browser-automation / library

Playwright for Go

Capability: Playwright for Go

Use it when

  • A Go service must scrape or exercise a JavaScript-rendered site and plain HTTP fetches return empty or skeleton markup
  • You want cross-browser end-to-end tests (Chromium, Firefox, WebKit) driven from a Go codebase without adding a Node or Python toolchain

What it solves

Not the fit when

  • Evading bot detection or CAPTCHA walls on protected sites
  • Static HTML pages where net/http plus an HTML parser is enough
  • Teams requiring a first-party Go binding or complete parity assurance; the maintainer describes test coverage as in progress
  • bot-detection-challenge
  • selector-rot

Install

go get -u github.com/mxschmitt/playwright-go; then install driver and browsers: go run github.com/mxschmitt/playwright-go/cmd/playwright@v0.xxxx.x install --with-deps (match the version in go.mod), or call playwright.Install() in code

Invoke

pw, _ := playwright.Run(); browser, _ := pw.Chromium.Launch(); page, _ := browser.NewPage(); page.Goto(url); page.Locator(".athing").All()

Alternatives

No reviewed alternatives recorded yet.