/drive-browser:drive-browserfrom drive-browser
Drives a browser with Playwright using resilient locators for your own web app or a vision/coordinate loop for opaque UI. Use for debugging, automating, scraping, or filling forms.
Ships in drive-browser. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Use Playwright for precise browser actions and for a screenshot-and-click loop. Pick how to interact by what the page exposes, not by habit.
How you find and act on elements:
getByRole/getByLabel/getByText first: they
auto-wait and re-resolve as the page changes. Use CSS only when a locator
can't express the target. This handles your own app and most real sites.Where the page runs:
These choices are independent: locators work with an existing login, and vision works in a fresh context. See setup and lifecycle recipes for connection, launch, and cleanup. For multi-step exploration, keep the browser and page handles in the host's persistent Node REPL rather than reconnecting for each action.
Prefer page.getByRole('button', { name: 'Save' }) and getByLabel('Email').
Use page.locator(css) only when needed, and page.evaluate(fn) for DOM reads
that locators don't express. Wait for the state you need (locator.waitFor(),
page.waitForURL(), page.waitForFunction()), not a guessed delay. For CSS-media
features, use page.emulateMedia({ reducedMotion: 'reduce' }).
Work one step at a time: screenshot → read the PNG → choose coordinates →
page.mouse.click(x, y) → screenshot again. Don't write a blind script with
guessed coordinates.
Take viewport screenshots with page.screenshot({ path: 'step.png', scale: 'css' }).
Each image pixel then matches a CSS pixel, so use the image coordinates directly
in page.mouse.click. Read the image at its original dimensions; a resized
preview changes the coordinates. Re-screenshot after anything that moves controls.
Use locator.fill(text) for text fields. If a widget needs individual keystrokes,
use locator.pressSequentially(text) or focus it and use page.keyboard.type(text).
Use press() for keys such as Enter or ArrowDown. Don't assign el.value directly
inside evaluate; it can leave the app's form state unchanged.
Attaching over CDP gives access to the user's live login without per-action prompts. You hold the line:
clear*/reset* calls there, including
Network.clearBrowserCookies. Use a new context for clean-state work.Use raw CDP only for capabilities Playwright lacks or a genuine zero-dependency requirement.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub pandysp/claude-plugins --plugin drive-browser