Skip to content

Commit 0cc6afa

Browse files
author
xing_lin
committed
Merge branch 'feat/cli' into feat/cli-test
2 parents c243e59 + 17282ad commit 0cc6afa

1 file changed

Lines changed: 18 additions & 13 deletions

File tree

browser-act/SKILL.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ The CLI is an open-source package published to PyPI by [BrowserAct](https://www.
6060
If the task is just "get content from a URL", use `stealth-extract` directly — no browser session needed. Each call launches its own headless stealth browser, extracts the page content, and closes automatically.
6161

6262
```bash
63-
browser-act stealth-extract <url> # Extract page content with anti-detection
63+
browser-act stealth-extract <url> # Extract rendered content as markdown (default)
64+
browser-act stealth-extract <url> --content-type html # Extract HTML instead of markdown
65+
browser-act stealth-extract <url> --proxy http://host:port # Use a proxy
66+
browser-act stealth-extract <url> --timeout 60 --output # Save to outputs/ instead of printing
6467
```
6568

6669
## Browser Selection
@@ -102,7 +105,7 @@ browser-act browser clear-profile <browser_id>
102105
| `--desc` | Browser description |
103106
| `--proxy <url>` | Proxy with scheme (`http`, `https`, `socks4`, `socks5`), e.g. `socks5://host:port` |
104107
| `--mode <normal\|private>` | `normal` (default): persists cache, cookies, login across launches. `private`: fresh environment every launch, no saved state |
105-
| `--cookie <json\|file>` | Pre-load cookies on creation. Accepts inline JSON object/array, or a path to a JSON file. See `references/commands.md` Cookies Management for format details |
108+
| `--cookie <json\|file>` | Pre-load cookies on creation. Accepts inline JSON object/array, or a path to a JSON file. Each cookie must include `name`, `value`, and `domain`. See `references/commands.md` Cookies Management for format details |
106109

107110
Stealth browsers in `normal` mode (default) persist cookies, cache, and login sessions across launches — you can log in once and reuse the session, similar to a regular browser profile. Use `--mode private` when the task should not persist any state.
108111

@@ -222,7 +225,6 @@ browser-act select <index> "option" # Select dropdown option by visible text
222225
browser-act keys "Enter" # Send keyboard keys
223226
browser-act scroll down # Scroll down (default 500px)
224227
browser-act scroll up --amount 1000 # Scroll with custom distance
225-
browser-act scrollintoview <index> # Scroll element into viewport
226228
browser-act scrollintoview --selector "h1" # Scroll element into viewport by CSS selector
227229
browser-act upload <index> <file_path> # Upload file to file input
228230

@@ -245,28 +247,31 @@ browser-act tab close <tab_id> # Close specific tab
245247
# Wait
246248
browser-act wait stable # Wait for page stable (doc ready + network idle, default 30s)
247249
browser-act wait stable --timeout 60000 # Custom timeout in ms
248-
browser-act wait --selector ".btn" --state visible # Wait for element state: visible|hidden|attached|detached
250+
browser-act wait --selector ".btn" --state visible --timeout 10000 # CSS selector wait
251+
browser-act wait selector <index> --state hidden # Wait by state index
252+
browser-act wait selector --selector "#login-btn" --state attached # States: visible|hidden|attached|detached
249253

250254
# Network Inspection
251-
browser-act network requests # List captured requests (--filter, --type, --method, --status)
255+
browser-act network requests # List captured requests (--filter, --type, --method, --status, --clear)
252256
browser-act network requests --filter api.example.com # Filter by URL substring
253-
browser-act network requests --type xhr,fetch # Resource type: xhr,fetch,document,script,stylesheet,image,font,media,websocket,ping,preflight,other
254-
browser-act network requests --method POST # HTTP method: GET, POST, PUT, DELETE, etc.
255-
browser-act network requests --status 2xx # Filter by http status code (200, 2xx, 400-499)
257+
browser-act network requests --type xhr,fetch # Resource type filter (comma-separated)
258+
browser-act network requests --method POST # HTTP method filter
259+
browser-act network requests --status 2xx --clear # Status filter, then clear tracked requests
256260
browser-act network request <id> # Full detail for a single request: headers, post data, response body
257261
browser-act network clear # Clear tracked requests
258262
browser-act network har start # Start HAR recording
259-
browser-act network har stop ./trace.har # Stop and save HAR
263+
browser-act network har stop ./trace.har # Stop and save HAR (path optional)
260264

265+
browser-act network offline # Simulate disconnect for current tab (same as "on")
261266
browser-act network offline on # Simulate disconnect for current tab (all requests fail with ERR_INTERNET_DISCONNECTED)
262267
browser-act network offline off # Restore network connection for current tab
263268

264269
# Cookies — persist within session, export/import for reuse across sessions
265270
browser-act cookies get [--url <url>] # Get cookies (optional URL filter)
266-
browser-act cookies set <name> <value> # Set cookie (--domain, --secure, --http-only, --same-site, --expires)
271+
browser-act cookies set <name> <value> [--domain <domain>] [--path /] [--secure] [--http-only] [--same-site <Strict|Lax|None>] [--expires <timestamp>]
267272
browser-act cookies clear [--url <url>] # Clear cookies
268-
browser-act cookies export ./cookies.json # Export all cookies to JSON file
269-
browser-act cookies import ./cookies.json # Import cookies from JSON file
273+
browser-act cookies export <file> [--url <url>] # Export cookies to JSON file
274+
browser-act cookies import <file> # Import cookies from JSON file
270275

271276
# Captcha
272277

@@ -283,7 +288,7 @@ A pending dialog will block all other commands — if `state`, `click`, or `scre
283288
```bash
284289
browser-act dialog status # Check for pending dialog
285290
browser-act dialog accept # Accept (OK)
286-
browser-act dialog accept "my input" # Accept with text input (prompt dialogs)
291+
browser-act dialog accept "my input" # Accept with prompt text
287292
browser-act dialog dismiss # Dismiss (Cancel)
288293
```
289294

0 commit comments

Comments
 (0)