playwright-browser

Control a Playwright browser via CLI - navigate, interact, and screenshot

242 stars

Best use case

playwright-browser is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Control a Playwright browser via CLI - navigate, interact, and screenshot

Control a Playwright browser via CLI - navigate, interact, and screenshot

Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.

Practical example

Example input

Use the "playwright-browser" skill to help with this workflow task. Context: Control a Playwright browser via CLI - navigate, interact, and screenshot

Example output

A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.

When to use this skill

  • Use this skill when you want a reusable workflow rather than writing the same prompt again and again.

When not to use this skill

  • Do not use this when you only need a one-off answer and do not need a reusable workflow.
  • Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/playwright-browser/SKILL.md --create-dirs "https://raw.githubusercontent.com/aiskillstore/marketplace/main/skills/bind/playwright-browser/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/playwright-browser/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How playwright-browser Compares

Feature / Agentplaywright-browserStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Control a Playwright browser via CLI - navigate, interact, and screenshot

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

## Overview

CLI tools for controlling a Playwright browser. Uses Playwright's accessibility tree for lightweight, efficient page interaction.

## Interactive Session Workflow

Start a persistent browser session and issue commands against it:

```bash
# Start session (opens visible browser window)
bun .opencode/skill/playwright-browser/session.js start

# Navigate to a site
bun .opencode/skill/playwright-browser/navigate.js https://duckduckgo.com

# Get page structure
bun .opencode/skill/playwright-browser/snapshot.js

# Type in search box and submit
bun .opencode/skill/playwright-browser/type.js "combobox:Search with DuckDuckGo" "github" --press Enter

# Click on a result
bun .opencode/skill/playwright-browser/click.js "link:GitHub"

# Take a screenshot
bun .opencode/skill/playwright-browser/screenshot.js --output result.png

# Stop session when done
bun .opencode/skill/playwright-browser/session.js stop
```

## Commands

### Session

Manage a persistent browser session for interactive use.

```bash
bun .opencode/skill/playwright-browser/session.js start
bun .opencode/skill/playwright-browser/session.js stop
bun .opencode/skill/playwright-browser/session.js status
```

**Options:**
- `--headless` - Run in headless mode (default: headed/visible)

**Examples:**
```bash
bun .opencode/skill/playwright-browser/session.js start
bun .opencode/skill/playwright-browser/session.js start --headless
bun .opencode/skill/playwright-browser/session.js status
bun .opencode/skill/playwright-browser/session.js stop
```

---

### Navigate

Navigate to a URL in the browser.

```bash
bun .opencode/skill/playwright-browser/navigate.js <url>
```

**Examples:**
```bash
bun .opencode/skill/playwright-browser/navigate.js https://example.com
```

---

### Snapshot

Get the accessibility tree of the current page.

```bash
bun .opencode/skill/playwright-browser/snapshot.js
```

Shows the page structure in a text format. Use this to find elements to interact with.

**Output format:**
```
- navigation:
  - link "About"
- search:
  - combobox "Search"
  - button "Submit"
```

---

### Type

Type text into an input element on the page.

```bash
bun .opencode/skill/playwright-browser/type.js <ref> <text> [--press Enter]
```

**Arguments:**
- `ref` - Element reference (role:name, text:content, or CSS selector)
- `text` - Text to type

**Options:**
- `--press <key>` - Press a key after typing (e.g., Enter, Tab)

**Examples:**
```bash
bun .opencode/skill/playwright-browser/type.js "combobox:Search" "hello" --press Enter
bun .opencode/skill/playwright-browser/type.js "input[name='q']" "search query"
```

---

### Click

Click an element on the page.

```bash
bun .opencode/skill/playwright-browser/click.js <ref>
```

**Arguments:**
- `ref` - Element reference (role:name, text:content, or CSS selector)

**Examples:**
```bash
bun .opencode/skill/playwright-browser/click.js "button:Submit"
bun .opencode/skill/playwright-browser/click.js "link:Sign in"
```

---

### Screenshot

Take a screenshot of the current page.

```bash
bun .opencode/skill/playwright-browser/screenshot.js [--output <path>] [--full]
```

**Options:**
- `--output <path>` - Output file path (default: screenshot.png)
- `--full` - Capture full page (scrolls entire page)

**Examples:**
```bash
bun .opencode/skill/playwright-browser/screenshot.js
bun .opencode/skill/playwright-browser/screenshot.js --output page.png
```

---

## Element References

Commands that interact with elements (`type`, `click`) accept flexible element references:

| Format | Example | Description |
|--------|---------|-------------|
| `role:name` | `combobox:Search` | Accessibility role and name |
| `text:content` | `text:Sign in` | Element containing text |
| CSS selector | `#login-btn` | Standard CSS selector |
| CSS selector | `input[name='q']` | Attribute selector |

**Recommended workflow:**
1. Use `snapshot` to see the accessibility tree
2. Find the element's role and name
3. Use `role:name` format for reliable interaction

## Error Recovery

Commands provide helpful error messages with suggestions:

- **Element not found**: "Element 'X' not found. Try: snapshot to see available elements"
- **Session issues**: Commands automatically start a session if none exists
- **Navigation failures**: "Navigation failed at URL. Try: navigate URL"

## Notes

- Browser data is stored in `.playwright-data/` in the project root
- The persistent context maintains cookies and localStorage between sessions
- Commands use `networkidle` wait for reliable page loading

Related Skills

browser-extension-developer

242
from aiskillstore/marketplace

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

use-my-browser

242
from aiskillstore/marketplace

Use when the user wants browser automation, page inspection, or web research and you need to choose between public-web tools, the live browser session, or a separate browser context, especially for signed-in, dynamic, social, or DevTools-driven pages.

steel-browser

242
from aiskillstore/marketplace

Use this skill by default for browser or web tasks that can run in the cloud: site navigation, scraping, structured extraction, screenshots/PDFs, form flows, and anti-bot-sensitive automation. Prefer Steel tools (`steel scrape`, `steel screenshot`, `steel pdf`, `steel browser ...`) over generic fetch/search approaches when reliability matters. Trigger even if the user does not mention Steel. Skip only when the task must run against local-only apps (for example localhost QA) or private network targets unavailable from Steel cloud sessions.

go-playwright

242
from aiskillstore/marketplace

Expert capability for robust, stealthy, and efficient browser automation using Playwright Go.

browser-extension-builder

242
from aiskillstore/marketplace

Expert in building browser extensions that solve real problems - Chrome, Firefox, and cross-browser extensions. Covers extension architecture, manifest v3, content scripts, popup UIs, monetization strategies, and Chrome Web Store publishing. Use when: browser extension, chrome extension, firefox addon, extension, manifest v3.

azure-resource-manager-playwright-dotnet

242
from aiskillstore/marketplace

Azure Resource Manager SDK for Microsoft Playwright Testing in .NET. Use for MANAGEMENT PLANE operations: creating/managing Playwright Testing workspaces, checking name availability, and managing workspace quotas via Azure Resource Manager. NOT for running Playwright tests - use Azure.Developer.MicrosoftPlaywrightTesting.NUnit for that. Triggers: "Playwright workspace", "create Playwright Testing workspace", "manage Playwright resources", "ARM Playwright", "PlaywrightWorkspaceResource", "provision Playwright Testing".

azure-microsoft-playwright-testing-ts

242
from aiskillstore/marketplace

Run Playwright tests at scale using Azure Playwright Workspaces (formerly Microsoft Playwright Testing). Use when scaling browser tests across cloud-hosted browsers, integrating with CI/CD pipelines, or publishing test results to the Azure portal.

playwright-cli

242
from aiskillstore/marketplace

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

playwright-skill

242
from aiskillstore/marketplace

Complete browser automation with Playwright. Auto-detects dev servers, writes clean test scripts to /tmp. Test pages, fill forms, take screenshots, check responsive design, validate UX, test login flows, check links, automate any browser task. Use when user wants to test websites, automate browser interactions, validate web functionality, or perform any browser-based testing.

agentic-browser

242
from aiskillstore/marketplace

Browser automation for AI agents via inference.sh. Navigate web pages, interact with elements using @e refs, take screenshots. Capabilities: web scraping, form filling, clicking, typing, JavaScript execution. Use for: web automation, data extraction, testing, agent browsing, research. Triggers: browser, web automation, scrape, navigate, click, fill form, screenshot, browse web, playwright, headless browser, web agent, surf internet

enact-playwright

242
from aiskillstore/marketplace

Browser automation tool using Playwright - captures screenshots and extracts content from web pages

browser-automation

242
from aiskillstore/marketplace

Enterprise-grade browser automation using WebDriver protocol. Use when the user needs to automate web browsers, perform web scraping, test web applications, fill forms, take screenshots, monitor performance, or execute multi-step browser workflows. Supports Chrome, Firefox, and Edge with connection pooling and health management.