Define an action sequence
Send a browser_instructions array with render: "html" or render: "png". Use CSS, XPath or text selectors. Each instruction finishes before the next one runs.
Click and wait for content
{
"source": "universal",
"url": "https://example.com/",
"render": "html",
"browser_instructions": [
{
"type": "click",
"selector": {
"type": "css",
"value": "button.load-more"
}
},
{
"type": "wait_for_element",
"selector": {
"type": "css",
"value": ".loaded-items"
}
}
]
}Supported instructions
| type | Arguments | Behavior |
|---|---|---|
| click | selector | Click the selected element. |
| input | selector, value | Enter text into an input. |
| scroll | x, y | Scroll by a pixel offset. |
| scroll_to_bottom | No selector | Scroll through the page. |
| wait | wait_time_s | Wait for a fixed interval. |
| wait_for_element | selector | Wait for a matching element. |
| fetch_resource | Resource selector | Return the first matching Fetch/XHR resource. |
Scroll horizontally to read all columns.
Timing and failure behavior
Use timeout_s to bound an action and wait_time_s to delay the next action. on_error: "error" stops instruction execution; on_error: "skip" continues to the next step. Choose skip only when the missing action does not invalidate the result.
Fetch a browser resource
fetch_resource returns the first matching Fetch/XHR resource instead of the page HTML. For a record of multiple browser requests, use xhr: true and inspect the XHR output type.