/openbrowser:web-scrapingfrom openbrowser
Extracts structured data from websites using browser automation and Python. Handles JavaScript-rendered content, pagination, infinite scroll, and multi-page scraping via local MCP tools.
Ships in openbrowser. 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.
None: SKILL.md is the whole skill.
Extract structured data from websites using Python code execution with browser automation functions. Handles JavaScript-rendered content, pagination, and multi-page scraping.
The CLI examples below run with openbrowser-ai -c. The MCP route runs the same browser functions inside execute_code; place a complete task sequence in one execute_code call and reuse its context_id for later calls. The CLI daemon starts automatically and persists variables across calls. Run openbrowser-ai warm once before a multi-call CLI workflow to start the daemon and browser before the workflow begins. Most browser functions are async, use await. list_downloads(), download_outcomes(), and download_failures() are synchronous.
openbrowser-ai -c needs no separate OpenAI, OpenBrowser, or MCP API key.
The CLI daemon persists cookies and login state in the Chrome user-data directory at ~/.config/openbrowser/profiles/daemon, so authenticated sessions can be reused across later runs. No storage_state.json file is written unless you configure one explicitly.
Best route. Use MCP scrape_web or openbrowser-ai scrape URL --no-browser for static pages. Use --engine http when a browser must not start. Batch static URLs with --jsonl --concurrency 8 or scrape_pages(..., engine='http', concurrency=8). Use --selector, --only-main-content, --include-tag, --exclude-tag, and --max-chars to return the smallest complete result. Use map and crawl for site discovery. Use the browser for JavaScript-rendered or cookie-bound pages, with --render-mode lightweight or no-render when visuals are outside the result. For a multi-step browser scrape, call create_context once, pass its context_id to every execute_code call, and call close_context when the task ends. Use openbrowser-ai -c for a one-off CLI scrape or when MCP is unavailable, and run openbrowser-ai warm once before repeated CLI calls. Both routes need no separate API key. Use get_status after a failed or stalled call, and reset_browser only when no usable page target remains.
Benchmark scope. The scraping resource benchmark in release 0.1.63 measures the native scrape worker: static HTTP work stays in that process, simple JavaScript pages run in an embedded QuickJS DOM, and unsupported pages fall back to one Playwright headless shell. That worker is a benchmark harness path. The CLI scrape and Python scrape_page routes described in this skill use the regular HTTP or browser route and do not run QuickJS. Use the same route for the same page across interfaces before comparing timing or memory.
Before running, verify openbrowser-ai is installed:
openbrowser-ai --help
If not found, install:
# macOS/Linux
curl -fsSL https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/billy-enrizky/openbrowser-ai/main/install.ps1 | iex
For a single page, prefer the built-in scrape command before writing code:
openbrowser-ai scrape <url> --format markdown
openbrowser-ai scrape <url> --format json --selector "article"
--engine auto (default) uses HTTP first and falls back to Chromium for thin JavaScript shells. Use --engine browser when JavaScript is required. The browser fallback uses the Playwright headless shell by default; set OPENBROWSER_USE_HEADLESS_SHELL=0 to force full Chrome.
Add --only-main-content to drop navigation, headers, footers, cookie banners, and ad blocks before extraction. --include-tag keeps the first matching selector, and --exclude-tag removes matches before extraction. They work on the HTTP path and on the browser fallback.
--render-mode accepts full, lightweight, or no-render. Lightweight blocks images, fonts, media, and text tracks. No-render adds external stylesheets and disables screenshots. For browser-fallback assets, use the granular flags for a specific asset policy: --text-only blocks CSS, images, fonts, media, and text tracks while keeping scripts and screenshots, and --no-css, --no-images, --no-fonts, and --no-media each block one group. --no-scripts applies to the one-shot prompt interface; scrape uses the asset flags. Blocking external CSS exposes content the page hides with display:none, so prefer lightweight when visibility matters. Use --wait-for <selector> for client-rendered content.
For several URLs, use batch mode. HTTP requests run concurrently, while browser fallbacks run one at a time:
openbrowser-ai scrape https://a.example https://b.example --jsonl --concurrency 8
openbrowser-ai scrape --urls-file urls.txt --output results.json
openbrowser-ai scrape --urls-file urls.txt --output results.jsonl
Use --output-format json or --output-format jsonl to choose batch serialization. A .jsonl output path selects JSONL by default. Each URL produces a record with url, ok, engine_used, content, error, duration_ms, and timing. A failed URL does not stop the batch.
For static pages, add --no-browser. This is OpenBrowser no-browser mode: a light console entry that does not import the browser or configuration stack, starts no Chrome, Blink, or V8 process, and never falls back to a browser:
openbrowser-ai scrape https://a.example https://b.example --no-browser --jsonl --concurrency 8
It cannot run JavaScript, take screenshots, or use browser cookies. --engine http selects the same HTTP-only path. Use auto when a page may need JavaScript, or browser when it definitely does. The asset flags --no-css, --no-images, --no-fonts, --no-media, and --render-mode control the browser fallback and leave the no-browser HTTP path unchanged.
In CodeAgent, call await scrape_page(url) for one page or await scrape_pages(urls, concurrency=4) for a batch. Each URL returns its own result, and results keep the input order. HTTP requests run concurrently up to the limit. Browser fallbacks run sequentially. Pass engine="http" to scrape_pages() when the batch is static and must not start a browser. That is OpenBrowser no-browser mode: it starts no Chrome, Blink, or V8 process and cannot run JavaScript, take screenshots, or use browser cookies. scrape_page and scrape_pages also accept only_main_content=True, include_tags=[...], and exclude_tags=[...].
Use map when you need to know which pages exist, and crawl when you need their content. Neither starts a browser.
openbrowser-ai map https://docs.example.com --max-urls 50 --exclude '\.pdf$'
openbrowser-ai crawl https://docs.example.com --max-pages 20 --max-depth 2 --format markdown
map reads the page, /sitemap.xml, and one sitemap index level. It normalizes, deduplicates, and filters by origin and by --include / --exclude regular expressions. crawl follows same-origin links breadth first, fetches and parses each page once, and reports ok, depth, title, content, and links_found per page.
In CodeAgent, call await map_urls(url) and await crawl_site(url, max_pages=20, max_depth=2). Both are HTTP-only, so a JavaScript shell page is reported as skipped.
openbrowser-ai -c - <<'EOF'
await navigate("https://example.com/data")
# Get browser state to see page title, URL, element count
state = await browser.get_browser_state_summary(include_screenshot=False)
print(f"Title: {state.title}")
print(f"URL: {state.url}")
print(f"Elements: {len(state.dom_state.selector_map)}")
EOF
Use evaluate() to run JS in the browser and return structured data directly as Python objects:
openbrowser-ai -c - <<'EOF'
data = await evaluate("""
(function(){
return Array.from(document.querySelectorAll(".product-card")).map(el => ({
name: el.querySelector(".title")?.textContent?.trim(),
price: el.querySelector(".price")?.textContent?.trim(),
url: el.querySelector("a")?.href
}))
})()
""")
import json
print(json.dumps(data, indent=2))
EOF
Use pandas, regex, or other Python tools to clean and transform extracted data:
openbrowser-ai -c - <<'EOF'
import json
# Filter and transform
filtered = [item for item in data if item.get("price")]
for item in filtered:
# Extract numeric price
price_str = item["price"].replace("$", "").replace(",", "")
item["price_float"] = float(price_str)
# Sort by price
filtered.sort(key=lambda x: x["price_float"])
print(json.dumps(filtered, indent=2))
EOF
Or with pandas if available:
openbrowser-ai -c - <<'EOF'
import pandas as pd
df = pd.DataFrame(data)
print(df.to_string())
EOF
openbrowser-ai -c - <<'EOF'
results = []
page = 1
while True:
# Extract data from current page
page_data = await evaluate("""
(function(){
return Array.from(document.querySelectorAll(".item")).map(el => ({
name: el.textContent.trim()
}))
})()
""")
results.extend(page_data)
print(f"Page {page}: {len(page_data)} items")
# Check for next button
has_next = await evaluate("""
(function(){ return !!document.querySelector(".pagination .next:not(.disabled)") })()
""")
if not has_next:
break
# Replace with the actual index from browser.get_browser_state_summary(include_screenshot=False)
await click(next_button_index)
await wait(2)
page += 1
print(f"Total: {len(results)} items")
EOF
openbrowser-ai -c - <<'EOF'
results = []
prev_count = 0
for _ in range(20): # Max 20 scroll attempts
# Get current items
count = await evaluate("""
(function(){ return document.querySelectorAll(".item").length })()
""")
if count == prev_count:
break # No new content loaded
prev_count = count
await scroll(down=True, pages=3)
await wait(1)
# Now extract all loaded items
results = await evaluate("""
(function(){
return Array.from(document.querySelectorAll(".item")).map(el => ({
text: el.textContent.trim()
}))
})()
""")
print(f"Extracted {len(results)} items")
EOF
openbrowser-ai -c - <<'EOF'
urls = [
"https://example.com/page-1",
"https://example.com/page-2",
"https://example.com/page-3",
]
all_data = []
for url in urls:
await navigate(url)
await wait(1)
page_data = await evaluate("""
(function(){
return document.querySelector("h1")?.textContent?.trim()
})()
""")
all_data.append({"url": url, "title": page_data})
print(f"{url}: {page_data}")
import json
print(json.dumps(all_data, indent=2))
EOF
-c - <<'EOF'), so all Python syntax works without shell escaping issues.evaluate() for structured DOM extraction -- it returns Python objects directly.wait_for_selector when a page renders asynchronously.get_tabs() to list tabs without a DOM scan. Pass the returned target_id as switch(tab_id=...) or close(tab_id=...) when a page opens a new tab.-c calls while the daemon is running, so you can build up results across multiple calls.Run this step after the task, whether it succeeded or failed.
MCP route cleanup. Call close_context with the same context_id after the last execute_code call. When the result is close_failed with retryable: true, call close_context again. Keep the close result in the task record.
Do not stop a daemon you did not start. Check openbrowser-ai daemon status before the first browser call. If it already reports a running daemon, reuse it and leave it running at the end. If it reports daemon_not_running, this run starts one and must clean it up.
For a daemon started by this run:
openbrowser-ai daemon stop
daemon stop only acknowledges the request and returns. Poll openbrowser-ai daemon status until it reports daemon_not_running, up to about 30 seconds. If the daemon does not exit, run openbrowser-ai daemon force-stop, which waits and verifies listener, owner, and browser cleanup.
If the task can fail mid-workflow, run the workflow and cleanup in one shell block. The same shell detects daemon ownership before installing the EXIT trap:
status=$(openbrowser-ai daemon status 2>&1 || true)
case "$status" in
*daemon_not_running*) OPENBROWSER_DAEMON_OWNED=1 ;;
*) OPENBROWSER_DAEMON_OWNED=0 ;;
esac
cleanup() {
if [ "${OPENBROWSER_DAEMON_OWNED:-0}" != "1" ]; then
return 0
fi
openbrowser-ai daemon stop >/dev/null 2>&1 || true
i=0
while [ "$i" -lt 30 ]; do
status=$(openbrowser-ai daemon status 2>&1 || true)
case "$status" in
*daemon_not_running*) return 0 ;;
esac
sleep 1
i=$((i + 1))
done
openbrowser-ai daemon force-stop >/dev/null 2>&1 || true
}
trap cleanup EXIT
# Place every openbrowser-ai -c call for this run in this same shell block.
Persist results to disk before stopping the daemon. daemon reset clears the Python namespace. Call done() only to mark the task complete inside the agent loop. Persist results and stop the daemon for cleanup.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
8 skills in this plugin
/accessibility-auditAudit web pages for accessibility issues, WCAG compliance, and screen reader compatibility.
Routes through keyless local MCP `create_context` and `execute_code` tools plus the `openbrowser-ai -c` CLI. No separate API key is required.
Trigger when the user asks to: check accessibility, run an a11y audit, test WCAG compliance,
check screen reader support, audit ARIA attributes, verify keyboard navigation,
find accessibility issues, or check for missing alt text or labels.
/deep-researchUse when the user asks for search, web search, source discovery, research, investigations, evidence gathering, comparisons, literature reviews, briefings, or cited reports.
Uses host reasoning with the keyless `openbrowser-ai web-search`, guarded `safe_scrape.py`, and `-c` CLI. The MCP `web_search` tool is an optional lead-generation helper; its snippets are not evidence. Browser capture uses the dedicated CLI daemon. No separate API key is required. The `-p` prompt route is an optional configured-provider route; this skill never uses it.
/e2e-testingTest web applications end-to-end by simulating user interactions and verifying expected outcomes.
Routes through keyless local MCP `create_context` and `execute_code` tools plus the `openbrowser-ai -c` CLI. No separate API key is required.
Trigger when the user asks to: test a web app, verify a user flow, run end-to-end tests,
QA a feature, check that a page works correctly, validate user journeys, or test a deployment.
/file-downloadDownload files from websites, save PDFs, and read downloaded content.
Routes through keyless local MCP `create_context` and `execute_code` tools plus the `openbrowser-ai -c` CLI. No separate API key is required.
Trigger when the user asks to: download a file, save a PDF, export a document,
fetch a file from a URL, grab a report, download and read a PDF, or save page content as a file.
/form-fillingFill out web forms, submit data, and handle login or registration flows.
Routes through keyless local MCP `create_context` and `execute_code` tools plus the `openbrowser-ai -c` CLI. No separate API key is required.
Trigger when the user asks to: fill a form, submit data on a website, log in to a site,
register an account, complete a checkout, enter information into fields, or automate form submission.
/page-analysisAnalyze web page content, structure, and layout to understand what a page contains and how it is organized.
Routes through keyless local MCP `create_context` and `execute_code` tools plus the `openbrowser-ai -c` CLI. No separate API key is required.
Trigger when the user asks to: analyze a page, understand page structure, inspect a website,
summarize page content, examine page layout, review a web page, or describe what is on a page.
npx claudepluginhub billy-enrizky/openbrowser-ai --plugin openbrowserOther plugins' skills for the same job