$npx -y skills add szsip239/teamclaw --skill browserwing--- name: browserwing homepage: https://github.com/browserwing/browserwing description: Control browser automation through HTTP API. Supports page navigation, element interaction (click, type, select), data extraction, accessibility snapshot analysis, screenshot, JavaScript ex
| 1 | # BrowserWing Executor API |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | BrowserWing Executor provides comprehensive browser automation capabilities through HTTP APIs. You can control browser navigation, interact with page elements, extract data, and analyze page structure. |
| 6 | |
| 7 | ## Configuration |
| 8 | |
| 9 | **API Base URL:** The BrowserWing Executor API address is configurable via environment variable. |
| 10 | |
| 11 | - **Environment Variable:** `BROWSERWING_EXECUTOR_URL` |
| 12 | - **Default Value:** `http://127.0.0.1:8080` |
| 13 | - **How to get the URL:** Read from environment variable `$BROWSERWING_EXECUTOR_URL`, if not set, use default `http://127.0.0.1:8080` |
| 14 | |
| 15 | **Base URL Format:** `${BROWSERWING_EXECUTOR_URL}/api/v1/executor` or `http://127.0.0.1:8080/api/v1/executor` (if env var not set) |
| 16 | |
| 17 | **Authentication:** Use `X-BrowserWing-Key: <api-key>` header or `Authorization: Bearer <token>` if required. |
| 18 | |
| 19 | **Important:** Always construct the API URL by reading the environment variable first. In shell commands, use: `${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}` |
| 20 | |
| 21 | ## Core Capabilities |
| 22 | |
| 23 | - **Page Navigation:** Navigate to URLs, go back/forward, reload |
| 24 | - **Element Interaction:** Click, type, select, hover on page elements |
| 25 | - **Data Extraction:** Extract text, attributes, values from elements |
| 26 | - **Accessibility Analysis:** Get accessibility snapshot to understand page structure |
| 27 | - **Advanced Operations:** Screenshot, JavaScript execution, keyboard input |
| 28 | - **Batch Processing:** Execute multiple operations in sequence |
| 29 | |
| 30 | ## API Endpoints |
| 31 | |
| 32 | ### 1. Discover Available Commands |
| 33 | |
| 34 | **IMPORTANT:** Always call this endpoint first to see all available commands and their parameters. |
| 35 | |
| 36 | ```bash |
| 37 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 38 | curl -X GET "${EXECUTOR_URL}/api/v1/executor/help" |
| 39 | ``` |
| 40 | |
| 41 | **Response:** Returns complete list of all commands with parameters, examples, and usage guidelines. |
| 42 | |
| 43 | **Query specific command:** |
| 44 | ```bash |
| 45 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 46 | curl -X GET "${EXECUTOR_URL}/api/v1/executor/help?command=extract" |
| 47 | ``` |
| 48 | |
| 49 | ### 2. Get Accessibility Snapshot |
| 50 | |
| 51 | **CRITICAL:** Always call this after navigation to understand page structure and get element RefIDs. |
| 52 | |
| 53 | ```bash |
| 54 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 55 | curl -X GET "${EXECUTOR_URL}/api/v1/executor/snapshot" |
| 56 | ``` |
| 57 | |
| 58 | **Response Example:** |
| 59 | ```json |
| 60 | { |
| 61 | "success": true, |
| 62 | "snapshot_text": "Clickable Elements:\n @e1 Login (role: button)\n @e2 Sign Up (role: link)\n\nInput Elements:\n @e3 Email (role: textbox) [placeholder: your@email.com]\n @e4 Password (role: textbox)" |
| 63 | } |
| 64 | ``` |
| 65 | |
| 66 | **Use Cases:** |
| 67 | - Understand what interactive elements are on the page |
| 68 | - Get element RefIDs (@e1, @e2, etc.) for precise identification |
| 69 | - See element labels, roles, and attributes |
| 70 | - The accessibility tree is cleaner than raw DOM and better for LLMs |
| 71 | - RefIDs are stable references that work reliably across page changes |
| 72 | |
| 73 | ### 3. Common Operations |
| 74 | |
| 75 | **Note:** All examples below use `EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}"` to read the API address from environment variable, with `http://127.0.0.1:8080` as fallback default. |
| 76 | |
| 77 | #### Navigate to URL |
| 78 | ```bash |
| 79 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 80 | curl -X POST "${EXECUTOR_URL}/api/v1/executor/navigate" \ |
| 81 | -H 'Content-Type: application/json' \ |
| 82 | -d '{"url": "https://example.com"}' |
| 83 | ``` |
| 84 | |
| 85 | #### Click Element |
| 86 | ```bash |
| 87 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 88 | curl -X POST "${EXECUTOR_URL}/api/v1/executor/click" \ |
| 89 | -H 'Content-Type: application/json' \ |
| 90 | -d '{"identifier": "@e1"}' |
| 91 | ``` |
| 92 | **Identifier formats:** |
| 93 | - **RefID (Recommended):** `@e1`, `@e2` (from snapshot) |
| 94 | - **CSS Selector:** `#button-id`, `.class-name` |
| 95 | - **XPath:** `//button[@type='submit']` |
| 96 | - **Text:** `Login` (text content) |
| 97 | |
| 98 | #### Type Text |
| 99 | ```bash |
| 100 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 101 | curl -X POST "${EXECUTOR_URL}/api/v1/executor/type" \ |
| 102 | -H 'Content-Type: application/json' \ |
| 103 | -d '{"identifier": "@e3", "text": "user@example.com"}' |
| 104 | ``` |
| 105 | |
| 106 | #### Extract Data |
| 107 | ```bash |
| 108 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 109 | curl -X POST "${EXECUTOR_URL}/api/v1/executor/extract" \ |
| 110 | -H 'Content-Type: application/json' \ |
| 111 | -d '{ |
| 112 | "selector": ".product-item", |
| 113 | "fields": ["text", "href"], |
| 114 | "multiple": true |
| 115 | }' |
| 116 | ``` |
| 117 | |
| 118 | #### Wait for Element |
| 119 | ```bash |
| 120 | EXECUTOR_URL="${BROWSERWING_EXECUTOR_URL:-http://127.0.0.1:8080}" |
| 121 | curl -X POST "${EXECUTOR_URL}/a |