scraper-executor
Agent for generating agent-browser scraper scripts using Actionbook selectors.
Generates and verifies web scraper scripts using verified selectors from Actionbook.
> /plugin marketplace add actionbook/actionbook > /plugin install actionbook@actionbook-marketplace
How it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Generates and verifies web scraper scripts using verified selectors from Actionbook.
name: code-generator model: sonnet tools: - mcp__actionbook__search_actions - mcp__actionbook__get_action_by_id - Read - Bash - Write
Generates and verifies web scraper scripts using verified selectors from Actionbook.
**Every generated script MUST be verified. If verification fails, fix and retry.**
┌─────────────────────────────────────────────────────┐ │ 1. Generate Script │ │ ↓ │ │ 2. Execute Script to Verify │ │ ↓ │ │ 3. Check Results │ │ ┌───┴───┐ │ │ Success Failure → Analyze → Fix → Go to 2 │ │ ↓ (max 3 retries) │ │ Output Script + Data Preview │ └─────────────────────────────────────────────────────┘
**Without `--standalone` flag → Output agent-browser bash commands:**
agent-browser open "https://example.com" agent-browser scroll down 2000 agent-browser get text ".selector" agent-browser close
**With `--standalone` flag → Output Playwright JavaScript:**
const { chromium } = require('playwright');
// ...1. **Fetch Actionbook data**
search_actions(query: "{domain} {keywords}")
get_action_by_id(id: "{best_match}")2. **Parse selector data** to extract:
3. **Determine output type**
4. **Generate code**
5. **Verify script (REQUIRED)**
6. **Output verified script** with usage instructions and data preview
| Part | Check | Pass Criteria | |------|-------|---------------| | **1** | Script Runs | No errors, no timeouts | | **2** | Data Correct | Content matches expected fields |
# Execute commands agent-browser open "https://example.com" agent-browser wait --load networkidle agent-browser get text ".selector" agent-browser close # Check: No errors? → Part 1 PASS
**After extracting data, verify the CONTENT is correct:**
Expected fields: name, description, website, year Extracted data: "Click to expand", "View Details", "", "Loading..." → FAIL: Extracted UI text instead of actual data → FIX: Wait for content load, extract from correct elements
**Data validation checklist:**
| Check | Failure Example | Fix Action | |-------|-----------------|------------| | Fields not empty | `name: ""` | Wrong selector | | No placeholder text | `"Loading..."`, `"..."` | Add wait for dynamic content | | No button/UI text | `"Click to expand"`, `"View Details"` | Extract content, not button labels | | Correct field mapping | `year: "San Francisco"` | Fix selector for each field | | Reasonable item count | Expected ~100, got 3 | Add scroll/pagination | | Data makes sense | `description: "2019"` | Fields are swapped, fix mapping |
# 1. Execute agent-browser open "https://example.com" agent-browser wait --load networkidle agent-browser get text ".selector" # 2. Analyze output: # - Script error? → Fix command syntax # - Empty data? → Fix selector # - Wrong content? → Fix extraction logic # Examples of wrong content: # - "Click to expand" instead of company name # - "Loading..." instead of description # - Numbers where text expected agent-browser close
# 1. Write and execute node /tmp/scraper.js # 2. Read output file and validate: # - JSON parse error? → Fix script syntax # - Empty array? → Fix selectors/wait logic # - Wrong field values? → Fix extraction mapping
1. **Max 3 retries** - If still failing, report the issue to user 2. **Always close browser** - Run `agent-browser close` even on failure 3. **Diagnose failure type:**
4. **Common data errors to catch:**
**If Actionbook selectors are wrong or need updates, log to `.actionbook-issues.log`:**
**When to log:**
**How to log (append to file):**
# Use Bash tool to append to log file echo "[$(date '+%Y-%m-%d %H:%M')] URL: https://example.com/page Action ID: https://example.com/page Issue Type: selector_error Details: Card selector no longer exists, page redesigned Selector: .company-list-card-small Expected: Company card container Actual: Element not found ---" >> .actionbook-issues.log
**Issue Types:** | Type | Description | |------|-------------| | `
Let your AI agent get the sources behind logins and paywalls.
Repo: actionbook/actionbook
Agent for generating agent-browser scraper scripts using Actionbook selectors.
Analyzes webpage structure using Actionbook data and presents selector information in a clear, actionable format.
Agent for submitting website indexing requests to Actionbook using **agent-browser CLI**.
Background agent for fetching arxiv.org web content using **agent-browser CLI**.
Background agent for reading ar5iv.org HTML papers using **agent-browser CLI**.