scrape_with_actions
Scrape pages that require interaction—logins, clicks, form fills, scrolling—by running browser actions first, then extracting content from SPAs and multi-step flows.
Instructions
Use this when you must interact with a page before scraping - login, click buttons, fill forms, scroll, or wait for dynamic content to load - for SPAs, login-gated content, or multi-step flows. Actions: wait, click, type, press, scroll, screenshot, executeJavaScript, select (dropdowns), hover, navigate. Set browserOptions.stealth:true to run the chain in the stealth browser. robots.txt is respected on every navigation. Screenshots from this tool are stored as crawlforge://screenshot/{actionId} resources. Not for pages that render without interaction (scrape) and not as the first attempt on a blocked site (stealth_mode operation:"scrape"). Cost: 5 credits. Example: scrape_with_actions({url: "https://app.com/dashboard", actions: [{type:"click",selector:"#login"},{type:"type",selector:"#email",text:"user@a.com"}]})
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | The URL to scrape | |
| actions | Yes | Browser actions to perform before scraping | |
| formats | No | Output formats for scraped content | |
| maxRetries | No | Maximum retry attempts on failure | |
| redact_pii | No | Redact personal data from the text this call returns, before it reaches your context window. true means the free regex pass over EMAIL, PHONE, FINANCIAL and SECRET. The result carries redaction:{entities,count}. Default: off | |
| formAutoFill | No | Form auto-fill configuration | |
| browserOptions | No | Browser configuration options | |
| respect_robots | No | Respect the target site's robots.txt (default: true). Setting this to false is honoured, returns a warning in the response, and is recorded against your API key — it is your decision, not a silent default. | |
| max_inline_chars | No | Largest result to return inline, in characters of its JSON. Over it, the call returns a preview plus a result_handle for read_result instead of the whole result (default 40,000; env CRAWLFORGE_MAX_INLINE_CHARS) | |
| extractionOptions | No | Content extraction options. selectors results are returned as content.json.extracted, so include "json" in formats when passing selectors — without it the extraction is not part of the response. | |
| screenshotOnError | No | Capture screenshot when an error occurs | |
| captureScreenshots | No | Take screenshots during action execution | |
| continueOnActionError | No | Continue executing actions if one fails | |
| captureIntermediateStates | No | Capture page state after each action |