scrape_with_actions
Execute browser action chains including click, scroll, type, and form auto-fill with screenshot capture. Perfect for login flows, infinite scroll, modal dialogs, and complex JavaScript-heavy sites.
Use Cases
Login Flows
Automate login forms and access authenticated content behind login walls
Infinite Scroll
Scrape content from infinite scroll pages like social media feeds and product listings
Modal Dialogs
Interact with popups, modals, and dynamic overlays
JavaScript-Heavy Sites
Handle SPAs and sites with dynamic content loading via AJAX
Multi-Step Forms
Navigate through multi-step wizards and complex form submissions
Visual Testing
Capture screenshots at each step for debugging and visual regression testing
Endpoint
/api/v1/tools/scrape_with_actions
Parameters
Name | Type | Required | Default | Description |
---|---|---|---|---|
url | string | Required | - | The starting URL for the scraping session Example: https://example.com/login |
actions | array | Required | - | Array of browser actions to perform sequentially Example: [{"type": "wait", "value": 2000}, {"type": "click", "selector": "#submit"}] |
formAutoFill | object | Optional | - | Auto-fill form fields with specified values Example: {"#username": "user@example.com", "#password": "secret"} |
captureScreenshots | boolean | Optional | false | Capture screenshots after each action Example: true |
waitForNavigation | boolean | Optional | true | Wait for navigation to complete after click actions Example: true |
Available Action Types
Request Examples
Response Example
{ "success": true, "data": { "content": "...final page content after all actions...", "screenshots": [ "data:image/png;base64,iVBORw0KGgoAAAANS...", "data:image/png;base64,iVBORw0KGgoAAAANS..." ], "intermediateStates": [ { "action": "type", "selector": "#search-input", "success": true, "timestamp": 1705334523000 }, { "action": "click", "selector": "#submit", "success": true, "timestamp": 1705334524500 } ], "finalState": { "url": "https://example.com/search?q=AI+web+scraping", "title": "Search Results - AI web scraping", "cookies": 12, "localStorage": 5 } }, "credits_used": 5, "credits_remaining": 995, "processing_time": 8450}
data.content
Final HTML content after executing all actionsdata.screenshots
Array of base64-encoded screenshots (if captureScreenshots: true)data.intermediateStates
Log of each action with success status and timestampdata.finalState
Final browser state including URL, cookies, and localStoragecredits_used
Credits deducted for this request (5 per scrape)processing_time
Total time including all actions and waitsError Handling
Action Failed (422 Unprocessable Entity)
One or more actions failed to execute. Check that selectors are correct and elements are visible.
Timeout (504 Gateway Timeout)
The action chain took too long to complete (max 30s). Reduce wait times or number of actions.
Invalid Action (400 Bad Request)
One or more actions have invalid parameters. Check action type and required fields.
Insufficient Credits (402 Payment Required)
Your account doesn't have enough credits (need 5). Purchase more credits or upgrade your plan.
Rate Limit Exceeded (429 Too Many Requests)
You've exceeded your plan's rate limit. Wait a moment or upgrade your plan for higher limits.
Credit Cost
Free Plan: 1,000 credits/month = 200 action chains
Hobby Plan: 5,000 credits/month = 1,000 action chains ($19/mo)
Professional Plan: 50,000 credits/month = 10,000 action chains ($99/mo)
Business Plan: 250,000 credits/month = 50,000 action chains ($399/mo)