1. Installation
.env
2. Provision a box and install Playwright
Create a box with outbound network access (the default) so it can reach the target site and download the browser binaries, then install Playwright and Chromium with its system dependencies.scripts/scrape.ts
3. Let the agent write and run the scraper
Hand the scraping task to the box’s built-in agent. It writes the Playwright script, runs it, fixes any issues it hits along the way, and saves the output to a file in the workspace.scripts/scrape.ts
4. Pull the results back
Read the file the agent wrote and bring it back into your own process.scripts/scrape.ts
5. Skip the setup on every run with snapshots
npx playwright install chromium --with-deps takes real time to stream and unpack OS-level packages. Paying that cost on every scrape request would be painful in production.
Snapshot the box once Chromium and its dependencies are installed, and restore from that snapshot whenever you need a ready-to-go scraping environment:
scripts/prepare-snapshot.ts
snapshot.id somewhere your application can reach (an env var, a database row, etc.), then spin up pre-warmed boxes from it on demand:
scripts/run-scrape-job.ts
apt-get and binary downloads.