Browser Actions
We offer a dedicated browser guide for retrieving browser resources. Utilizing fetch_resource
will yield the job returning the initial instance of a Fetch/XHR resource matching the specified format, rather than the HTML targeted.
For example, you may target an API resource that is fetched when loading a website containing product data:
{
"target": "universal",
"url": "https://example.com/product/1",
"headless": "html",
"browser_actions": [
{
"type": "fetch_resource",
"format": "/api/product/1"
}
]
}
Results
{
"results": [
{
"content": "{Product information here}",
"status_code": 200,
"url": "https://example.com/api/product/1",
"task_id": "7131940420107377665",
"created_at": "2023-11-19 09:46:41",
"updated_at": "2023-11-19 09:47:08"
}
]
}
Actions
click
click
Name | Arguments | Description |
---|---|---|
click | Selectors ["xpath", "css", "text"] value: string | Clicks an element and wait a set count of seconds. |
input
input
Name | Arguments | Description |
---|---|---|
input | Selectors ["xpath", "css", "text"] value: string | Enters a text into a selected element. |
scroll
scroll
Name | Arguments | Description |
---|---|---|
scroll | x: integer y: integer | Scrolls a set count of pixels. |
scroll_to_bottom
scroll_to_bottom
Name | Arguments | Description |
---|---|---|
scroll_to_bottom | - | Scrolls to bottom for a set count of seconds. |
wait
wait
Name | Arguments | Description |
---|---|---|
wait | - | Waits a set count of seconds. |
wait_for_element
wait_for_element
Name | Arguments | Description |
---|---|---|
wait_for_element | Selectors ["xpath", "css", "text"] value: string | Waits for element to load for a set count of seconds. |
fetch_resource
fetch_resource
Name | Arguments | Description |
---|---|---|
fetch_resource | - | Fetches the first occurrence of a Fetch/XHR resource matching the set pattern. |
fetch_resource
cannot be combined with any other instructions and should be used with separate requests.
fetch_resource
cannot be combined with any other instructions and should be used with separate requests.General Arguments
Arguments available for all actions above
type
type
Name | Description |
---|---|
type | Type of browser action used |
timeout_s
timeout_s
Name | Description |
---|---|
timeout_s | How much time in seconds to wait at max until the execution of the action is terminated. |
wait_time_s
wait_time_s
Name | Description |
---|---|
wait_time_s | How much time in seconds to use explicitly to execute the action. |
on_error
on_error
Name | Description |
---|---|
on_error | Indicator what to do with actions in case they fail: "error": Stops the execution of browser actions. "skip": Continues with the next action. |
Updated 4 days ago