Scrape Elements
Cloudflare Browser Run
Cloudflare Browser Run
Scrape Elements
Scrape specific HTML elements from a page by CSS selector.
ActionAI Tool
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
url | text | Required | The URL to navigate to. Provide either url or html. |
html | text | Optional | Raw HTML to render instead of navigating to a URL. Provide either url or html. |
gotoOptions | object | Optional | Navigation options controlling how the page is loaded. |
waitUntil | select | Optional | When to consider navigation finished. (options: Load, DOM Content Loaded, Network Idle 0, Network Idle 2) |
timeout | number | Optional | Maximum navigation time in milliseconds. |
referer | text | Optional | Referer header value. |
viewport | object | Optional | Viewport dimensions and device settings. |
width | number | Optional | Viewport width in pixels. |
height | number | Optional | Viewport height in pixels. |
deviceScaleFactor | number | Optional | Device scale factor (pixel density). |
setExtraHTTPHeaders | dynamic object | Optional | Extra HTTP headers to send with the request. |
cookies | array of object | Optional | Cookies to set before loading the page. |
name | text | Required | Cookie name. |
value | text | Required | Cookie value. |
domain | text | Optional | Cookie domain. |
url | text | Optional | Cookie URL. |
path | text | Optional | Cookie path. |
authenticate | object | Optional | HTTP basic auth credentials. |
username | text | Optional | HTTP auth username. |
password | text | Optional | HTTP auth password. |
userAgent | text | Optional | Custom user agent string. |
waitForSelector | text | Optional | Wait for this CSS selector to appear before capturing. |
rejectResourceTypes | array of text | Optional | Resource types to block, e.g. image, stylesheet, font. |
rejectRequestPattern | array of text | Optional | Regex patterns; matching requests are blocked. |
elements | array of object | Required | Elements to scrape, each identified by a CSS selector. |
selector | text | Required | CSS selector. |
Outputs
| Name | Type | Description |
|---|---|---|
statusCode | number | HTTP status code. |
body | object | Cloudflare API response. |
success | yes/no | Whether the request succeeded. |
result | array of object | Scraped element results, one entry per selector. |
selector | text | CSS selector. |
results | array | Matched elements. Further: item fields: text, html, height, width, top, left, attributes. |
errors | array of object | Errors returned by the API. |
code | number | Error code. |
message | text | Error message. |