Create new browser automation scripts step-by-step. Use when starting a new automation from scratch or when the user wants to automate a website task.
Guide Claude through creating new browser automation scripts using the browse CLI.
Use this skill when:
Requires the browse CLI and Chrome/Chromium:
browse --version # Check if installed
bash scripts/setup-browse.sh # Install if needed
Install manually: pnpm add -g @browserbasehq/browse-cli
Ask clarifying questions:
The browse CLI auto-starts a Chrome daemon on first command. State persists between commands.
browse goto https://example.com
browse snapshot
Take screenshots to see the visual layout:
browse screenshot -o exploration.png
For each step of the automation, identify:
Use the accessibility tree refs to understand element relationships:
[@0-5] button: "Submit"
[@0-6] textbox: "Email"
[@0-7] textbox: "Password"
Before writing code, verify each step works:
browse fill @0-6 "test@example.com"
browse fill @0-7 "password123"
browse click @0-5
browse wait networkidle
browse snapshot
For API-based automations or debugging:
browse network on
# perform actions
browse network list
browse network show 0
Once you understand the flow, create a full function project.
For serverless deployment, see the /functions skill which covers the bb CLI.
For a quick script, write the automation logic:
import { chromium } from "playwright-core";
async function automate() {
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage();
// Your automation steps here
await page.goto("https://example.com");
await page.fill('input[name="email"]', "user@example.com");
await page.click('button[type="submit"]');
// Extract and return data
const result = await page.textContent('.result');
console.log(result);
await browser.close();
}
automate();
When done exploring:
browse stop
data-testid) over CSS classestext=Submit)waitForSelector for dynamic contentpage.evaluate() for complex extractionimport { chromium } from "playwright-core";
async function monitorPrice(productUrl: string) {
const browser = await chromium.launch({ headless: true });
const page = await browser.newPage();
await page.goto(productUrl);
await page.waitForSelector('.price');
const price = await page.evaluate(() => {
const el = document.querySelector('.price');
return el?.textContent?.replace(/[^0-9.]/g, '');
});
await browser.close();
return {
url: productUrl,
price: parseFloat(price || '0'),
timestamp: new Date().toISOString(),
};
}
Once you've tested your automation interactively:
/functions skill to deploy to Browserbase/auth skill for handling logins