Spin up unblocked browser sessions via Browser.cash for web automation. Sessions bypass anti-bot protections (Cloudflare, DataDome, etc.) making them ideal for scraping and automation.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install browser-cash或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install browser-cash⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/browser-cash/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: browser-cash description: Spin up unblocked browser sessions via Browser.cash for web automation. Sessions bypass anti-bot protections (Cloudflare, DataDome, etc.) making them ideal for scraping and automation. homepage: https://browser.cash metadata: {"clawdbot":{"emoji":"🌐","requires":{"bins":["curl","jq"]}}} ---
Spin up unblocked browser sessions via Browser.cash for web automation. These sessions bypass common anti-bot protections (Cloudflare, DataDome, etc.), making them ideal for scraping, testing, and automation tasks that would otherwise get blocked.
When to use: Any browser automation task—scraping, form filling, testing, screenshots. Browser.cash sessions appear as real browsers and handle bot detection automatically.
API Key is stored in clawdbot config at skills.entries.browser-cash.apiKey.
If not configured, prompt the user: > Get your API key from https://dash.browser.cash and run: > ```bash > clawdbot config set skills.entries.browser-cash.apiKey "your_key_here" > ```
Reading the key:
BROWSER_CASH_KEY=$(clawdbot config get skills.entries.browser-cash.apiKey)
Before first use, check and install Playwright if needed:
if [ ! -d ~/clawd/node_modules/playwright ]; then
cd ~/clawd && npm install playwright puppeteer-core
fi
curl -X POST "https://api.browser.cash/v1/..." \
-H "Authorization: Bearer $BROWSER_CASH_KEY" \
-H "Content-Type: application/json"
Basic session:
curl -X POST "https://api.browser.cash/v1/browser/session" \
-H "Authorization: Bearer $BROWSER_CASH_KEY" \
-H "Content-Type: application/json" \
-d '{}'
Response:
{
"sessionId": "abc123...",
"status": "active",
"servedBy": "node-id",
"createdAt": "2025-01-20T01:51:25.000Z",
"stoppedAt": null,
"cdpUrl": "wss://gcp-usc1-1.browser.cash/v1/consumer/abc123.../devtools/browser/uuid"
}
With options:
curl -X POST "https://api.browser.cash/v1/browser/session" \
-H "Authorization: Bearer $BROWSER_CASH_KEY" \
-H "Content-Type: application/json" \
-d '{
"country": "US",
"windowSize": "1920x1080",
"profile": {
"name": "my-profile",
"persist": true
}
}'
| Option | Type | Description | |--------|------|-------------| | country | string | 2-letter ISO code (e.g., "US", "DE", "GB") | | windowSize | string | Browser dimensions, e.g., "1920x1080" | | proxyUrl | string | SOCKS5 proxy URL (optional) | | profile.name | string | Named browser profile for session persistence | | profile.persist | boolean | Save cookies/storage after session ends |
Browser.cash returns a WebSocket CDP URL (wss://...). Use one of these approaches:
Important: Before running Playwright/Puppeteer scripts, ensure dependencies are installed:
[ -d ~/clawd/node_modules/playwright ] || (cd ~/clawd && npm install playwright puppeteer-core)
Use Playwright or Puppeteer in an exec block to connect directly to the CDP URL:
# 1. Create session
BROWSER_CASH_KEY=$(clawdbot config get skills.entries.browser-cash.apiKey)
SESSION=$(curl -s -X POST "https://api.browser.cash/v1/browser/session" \
-H "Authorization: Bearer $BROWSER_CASH_KEY" \
-H "Content-Type: application/json" \
-d '{"country": "US", "windowSize": "1920x1080"}')
SESSION_ID=$(echo $SESSION | jq -r '.sessionId')
CDP_URL=$(echo $SESSION | jq -r '.cdpUrl')
# 2. Use via Node.js exec (Playwright)
node -e "
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.connectOverCDP('$CDP_URL');
const context = browser.contexts()[0];
const page = context.pages()[0] || await context.newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
await browser.close();
})();
"
# 3. Stop session when done
curl -X DELETE "https://api.browser.cash/v1/browser/session?sessionId=$SESSION_ID" \
-H "Authorization: Bearer $BROWSER_CASH_KEY"
For simple tasks, use curl to interact with pages via CDP commands:
# Navigate and extract content using the CDP URL
# (See CDP protocol docs for available methods)
Clawdbot's native browser tool expects HTTP control server URLs, not raw WebSocket CDP. The gateway config.patch approach works when Clawdbot's browser control server proxies the connection. For direct Browser.cash CDP, use the exec approach above.
curl "https://api.browser.cash/v1/browser/session?sessionId=YOUR_SESSION_ID" \
-H "Authorization: Bearer $BROWSER_CASH_KEY"
Statuses: starting, active, completed, error
curl -X DELETE "https://api.browser.cash/v1/browser/session?sessionId=YOUR_SESSION_ID" \
-H "Authorization: Bearer $BROWSER_CASH_KEY"
curl "https://api.browser.cash/v1/browser/sessions?page=1&pageSize=20" \
-H "Authorization: Bearer $BROWSER_CASH_KEY"
Profiles persist cookies, localStorage, and session data across sessions—useful for staying logged in or maintaining state.
List profiles:
curl "https://api.browser.cash/v1/browser/profiles" \
-H "Authorization: Bearer $BROWSER_CASH_KEY"
Delete profile:
curl -X DELETE "https://api.browser.cash/v1/browser/profile?profileName=my-profile" \
-H "Authorization: Bearer $BROWSER_CASH_KEY"
The cdpUrl is a WebSocket endpoint for Chrome DevTools Protocol. Use it with any CDP-compatible library.
Playwright:
const { chromium } = require('playwright');
const browser = await chromium.connectOverCDP(cdpUrl);
const context = browser.contexts()[0];
const page = context.pages()[0] || await context.newPage();
await page.goto('https://example.com');
Puppeteer:
const puppeteer = require('puppeteer-core');
const browser = await puppeteer.connect({ browserWSEndpoint: cdpUrl });
const pages = await browser.pages();
const page = pages[0] || await browser.newPage();
await page.goto('https://example.com');
# 0. Ensure Playwright is installed
[ -d ~/clawd/node_modules/playwright ] || (cd ~/clawd && npm install playwright puppeteer-core)
# 1. Create session
BROWSER_CASH_KEY=$(clawdbot config get skills.entries.browser-cash.apiKey)
SESSION=$(curl -s -X POST "https://api.browser.cash/v1/browser/session" \
-H "Authorization: Bearer $BROWSER_CASH_KEY" \
-H "Content-Type: application/json" \
-d '{"country": "US", "windowSize": "1920x1080"}')
SESSION_ID=$(echo $SESSION | jq -r '.sessionId')
CDP_URL=$(echo $SESSION | jq -r '.cdpUrl')
# 2. Connect with Playwright/Puppeteer using $CDP_URL...
# 3. Stop session when done
curl -X DELETE "https://api.browser.cash/v1/browser/session?sessionId=$SESSION_ID" \
-H "Authorization: Bearer $BROWSER_CASH_KEY"
When extracting data from pages with lazy-loading or infinite scroll:
// Scroll to load all products
async function scrollToBottom(page) {
let previousHeight = 0;
while (true) {
const currentHeight = await page.evaluate(() => document.body.scrollHeight);
if (currentHeight === previousHeight) break;
previousHeight = currentHeight;
await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
await page.waitForTimeout(1500); // Wait for content to load
}
}
// Wait for specific elements
await page.waitForSelector('.product-card', { timeout: 10000 });
// Handle "Load More" buttons
const loadMore = await page.$('button.load-more');
if (loadMore) {
await loadMore.click();
await page.waitForTimeout(2000);
}
...
安装 Browser Cash 后,可以对 AI 说这些话来触发它
Help me get started with Browser Cash
Explains what Browser Cash does, walks through the setup, and runs a quick demo based on your current project
Use Browser Cash to spin up unblocked browser sessions via Browser
Invokes Browser Cash with the right parameters and returns the result directly in the conversation
What can I do with Browser Cash in my data & analytics workflow?
Lists the top use cases for Browser Cash, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/browser-cash/ 目录(个人级,所有项目可用),或 .claude/skills/browser-cash/(项目级)。重启 AI 客户端后,用 /browser-cash 主动调用,或让 AI 根据上下文自动发现并使用。
Browser Cash 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Browser Cash 可免费安装使用。请查阅仓库了解许可证信息。
Spin up unblocked browser sessions via Browser.cash for web automation. Sessions bypass anti-bot protections (Cloudflare, DataDome, etc.) making them ideal for scraping and automation.
Browser Cash 属于「Data & Analytics」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my data & analytics tasks using Browser Cash
Identifies repetitive steps in your workflow and sets up Browser Cash to handle them automatically