Skip to main content

Advanced Actions

Human-like interaction, Cloudflare bypass, and JavaScript evaluation.

clickHuman

Click an element using the Chrome Debugger protocol with a realistic bezier curve mouse path (30-50 points with random jitter). This creates human-like mouse movement patterns.

Value: string (selector)

{ "clickHuman": "#login-btn" }

Options

OptionTypeDefaultDescription
offsetXnumber0Horizontal offset from element center
offsetYnumber0Vertical offset from element center
modestringSet to "fast" to start mouse ~100px from target
{
"clickHuman": ".submit-button",
"options": { "mode": "fast" }
}

A visible SVG cursor animation with scale effect is shown during the movement.

hoverHuman

Hover over an element with a realistic bezier curve mouse path (no click). Uses Chrome Debugger protocol.

Value: string (selector)

{ "hoverHuman": ".tooltip-trigger" }

Options

OptionTypeDefaultDescription
offsetXnumber0Horizontal offset
offsetYnumber0Vertical offset

byPassCloudflare

Bypass Cloudflare's browser verification challenge by detecting the closed shadow DOM checkbox and performing a realistic click via the Chrome Debugger.

Value: true

{ "byPassCloudflare": true }

Options

OptionTypeDefaultDescription
offsetXnumber0Fine-tune click position
offsetYnumber0Fine-tune click position

Example

{
"actions": [
{ "openNewTab": "https://protected-site.example.com" },
{ "wait": 3000 },
{ "byPassCloudflare": true },
{ "waitForElement": "#main-content", "options": { "timeout": 15000 } },
{ "screenshot": "viewport" }
]
}

evaluate

Execute arbitrary JavaScript in the page's MAIN world. The code runs with full access to the page's JavaScript context.

Value: string (JavaScript code)

{ "evaluate": "document.title" }

Returns: The return value of the evaluated expression.

Options

OptionTypeDefaultDescription
savestringCache the return value
pushstringPush return value into array
{
"evaluate": "document.querySelectorAll('.item').length",
"options": { "save": "itemCount" }
}

Return Values

The last expression in your code is returned:

{
"evaluate": "(() => { const el = document.querySelector('.price'); return parseFloat(el.textContent.replace('$', '')); })()",
"options": { "save": "numericPrice" }
}

Modify the Page

{ "evaluate": "document.body.style.zoom = '80%'" }
{ "evaluate": "window.scrollTo(0, document.body.scrollHeight)" }

Access Page Variables

{
"evaluate": "JSON.stringify(window.__NEXT_DATA__.props)",
"options": { "save": "nextData" }
}

Example: Human-Like Login

{
"actions": [
{ "openNewTab": "https://example.com/login" },
{ "wait": 2000 },
{ "clickHuman": "input[name=email]" },
{ "fill": ["input[name=email]", "user@example.com"], "options": { "delay": 80 } },
{ "wait": 500 },
{ "clickHuman": "input[name=password]" },
{ "fill": ["input[name=password]", "mypassword"], "options": { "delay": 60 } },
{ "wait": 1000 },
{ "clickHuman": "button[type=submit]", "options": { "mode": "fast" } },
{ "waitForElement": ".dashboard" }
]
}

Example: Cloudflare Protected Site

{
"actions": [
{ "openNewTab": "https://protected-site.com" },
{ "wait": 4000 },
{ "byPassCloudflare": true },
{ "wait": 3000 },
{ "waitForElement": "body", "options": { "timeout": 15000 } },
{ "screenshot": "viewport" }
]
}