When to Use This Skill
Activate when the user wants to obtain data from a website:
- "Extract all product prices from this page"
- "Scrape the table of results from ..."
- "Pull the list of authors and titles from arXiv search results"
- "Collect all job listings from this page"
- "Get the data from this dashboard table"
- "Harvest review scores from ..."
- "Download all the links/images/cards from ..."
The deliverable is always two artifacts:
- Executable Playwright script — a standalone
.cjsfile that reproduces the extraction without Actionbook at runtime. - Extracted data — JSON (default), CSV, or user-specified format written to disk.
Decision Strategy
Use Actionbook as a conditional accelerator, not a mandatory step. The goal is reliable selectors in the shortest path.
Priority order for selector sources:
Non-negotiable rule: if search + get already provides usable selectors for required fields, start from get selectors and do not jump to full fallback (snapshot/screenshot) by default. Exception: lightweight mechanism probes (for hydration/virtualization/pagination) are allowed when runtime behavior may affect script correctness. Escalate to snapshot/screenshot only when probes/sample validation indicate selector gaps or instability.
Mechanism-Aware Script Strategy
Websites use patterns that break naive scraping. The generated Playwright script must account for these:
Streaming / SSR / RSC hydration
Pages may render a shell first, then stream or hydrate content.
Detection cues: React root with data-reactroot, Next.js __NEXT_DATA__, empty containers that fill after JS runs. If actionbook browser text "<selector>" returns empty but the screenshot shows content, hydration hasn't completed.
Virtualized lists / virtual DOM
Only visible rows exist in the DOM. Scrolling renders new rows and destroys old ones.
Detection cues: Container has fixed height with overflow: auto/scroll, row count in DOM is much smaller than stated total, rows have transform: translateY(...) or position: absolute; top: ...px.
Infinite scroll / lazy loading
New content appends when the user scrolls near the bottom.
Detection cues: Intersection Observer in page JS, "Load more" button, sentinel element at bottom, network requests firing on scroll.
Pagination
Multi-page results behind "Next" buttons or numbered pages.
Execution Chain
Step 1: Understand the target
Identify from the user request:
- URL — the page to extract from
- Data shape — what fields / columns are needed
- Scope — single page, paginated, infinite scroll, or multi-page crawl
- Output format — JSON (default), CSV, or other
Step 2: Obtain selectors and choose execution path
Use this routing strictly:
-
Path A (default when
getis good): requested fields are covered bygetselectors and quality is acceptable.- Start from
getselectors and move to script draft quickly. - You may run lightweight mechanism probes (
browser text, quick scroll checks) before finalizing script strategy. - Do not run full fallback (
snapshot/screenshot) before first draft unless probe/sample validation shows mismatch. - Field mapping must default to
getselectors and mark source asactionbook_get.
- Start from
-
Path B (partial / unstable):
getexists but required fields are missing, selector resolves 0 elements, or validation fails.- Run targeted fallback only for failed fields/steps.
-
Path C (no usable coverage): search/get has no usable result.
- Run full fallback discovery.
Step 3: Probe page mechanisms and fallback only when needed
Path A mechanism detection timing:
- Run minimal probes either before final script draft or during sample validation.
- Before any probe command, ensure the correct page context is open:
actionbook browser open "<url>"(if current tab context is unknown/stale)
- If probes/sample run indicate mismatch (missing rows, unstable selectors, wrong pagination behavior), escalate to Path B targeted fallback.
Fallback discovery by path:
Path B targeted fallback (only failed fields/steps):
Path C full fallback (no usable coverage):
Mechanism probes (run when script strategy needs confirmation):
Fallback trigger conditions:
actionbook getcannot map all required fields.actionbook getselectors return empty/unstable values in sample run.- Runtime behavior conflicts with expected mechanism (e.g., virtualized container, delayed hydration).
Step 4: Generate Playwright script
Write a standalone Playwright script (extract_<domain>_<slug>.cjs) that:
- Navigates to the target URL.
- Waits for the correct readiness signal (not just
load— see mechanisms above). - Handles the detected mechanism (virtual scroll, pagination, etc.).
- Extracts data into structured objects.
- Writes output to disk (
JSON.stringify/ CSV). - Closes the browser.
- Enforces guardrails (
maxPages,maxScrolls, timeout budget) to avoid infinite loops.
Script template:
Step 5: Execute and validate
Run the script to confirm it works:
Validation rules:
If validation fails, inspect the output, adjust selectors or wait strategy, and re-run.
Step 6: Deliver
Present to the user:
- Script path — the
.cjsfile they can re-run anytime. - Data path — the output JSON/CSV file.
- Record count — how many items were extracted.
- Notes — any mechanism-specific caveats (e.g., "this site uses infinite scroll; the script scrolls up to 50 pages by default").
Output Contract
Every extract invocation produces:
The script must be re-runnable — a user should be able to execute it later without Actionbook installed, as long as Node.js + Playwright are available in the runtime environment.
Selector Priority
When multiple selector types are available from actionbook get:


