Antibot

Experimental Scrapium
Scrapium domain. Antibot is not part of the official Chrome DevTools Protocol. It is a Scrapium extension and only works on Scrapfly Cloud Browser.

Dependencies: Accessibility, Page

Commands

Antibot.performAction

Scrapium

Performs an accessibility action on a node identified by AXNodeId.
When the node is not found yet (an OOPIF's accessibility tree can take
a moment to be ready), keeps looking for about 2 seconds before failing.
Antibot.disable sent meanwhile ends it: it answers "the domain was
disabled" and acts on nothing.

Parameters

Name Type Description
axNodeId Accessibility.AXNodeId
action string AX action to perform. Currently only "doDefault" is implemented.
frameId (optional) Page.FrameId Frame containing the target node. If omitted, uses the main frame.
metadata (optional) string Ignored.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.findAndPerformAction

Scrapium

Searches the accessibility tree of every frame (including OOPIFs), or
of the frames frameUrl or frameIds names, for a node matching the
selector, then performs the specified action.
Only "role" and "axNodeId" selector types are supported.
For "role" type, query is the AX role (e.g. "checkbox", "button")
and the accessibility tree of each frame searched is read. This works for
OOPIF frames where CDP Accessibility.getFullAXTree cannot reach
cross-process nodes.
Keeps looking every 300 milliseconds while nothing matches, until its
timeout. Antibot.disable sent meanwhile ends the search: it answers "the
domain was disabled" and acts on nothing.

Parameters

Name Type Description
selector Selector Only "role" and "axNodeId" selector types are supported.
action string AX action to perform. Currently only "doDefault" is implemented.
name (optional) string Optional AX accessible name substring to match. Filters matched
nodes by their accessible name. Works with both role and axNodeId.
frameUrl (optional) string Optional frame URL glob pattern to restrict search (e.g. "*example.com*").
Ignored when frameIds is given.
frameIds (optional) array<Page.FrameId> The frames to search, as getFrames lists them, in this order: each
look searches them all, and the first node found in that order is the
one acted on. A listed frame that is no longer in the page is skipped;
when none of them is, or the list is empty, the command answers at
once with an errorMessage that starts with "No listed frame". Replaces
frameUrl. Default: every frame.
timeout (optional) integer How long to keep looking, in milliseconds. Default: 12000.

Return Object

Name Type Description
success boolean
errorMessage (optional) string
foundNodeId (optional) string The AX node ID that was found and acted upon.
foundRole (optional) string The role of the found node.
foundName (optional) string The name of the found node.
framesSearched (optional) integer With frameIds: how many of the listed frames the last look searched.
foundFrameId (optional) Page.FrameId With frameIds: the frame of the node acted upon.

Antibot.moveTo

Scrapium

Moves mouse to target along a human-like path. A longer move may
go slightly past the target, then come back to it.
On Android, iPhone and iPad the pointer is a finger, which moves above
the screen: the page receives no event for the move. A target out of view
is first scrolled to with a finger's swipe, whose touch events the page
receives.
Supports all selector types except bottom.
While the page, or a frame the command looks in, is still loading its
document (before its DOMContentLoaded event), a css, xpath, pierce or role
target that is not there yet, or has no box yet, is looked for until it is,
those documents have loaded, or about 30 seconds have passed: only then does
the command fail with its lookup's error, "Element not found",
"Element not found in any frame" once it has looked in the page's frames,
"No frames match URL pattern: ..." when no frame matches frameUrl, or for a
role "No AX node found with role=..." or "Element has empty bounds". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a target that is not there fails the
command at once, and a backendNodeId or axNodeId target is looked up once.
Antibot.disable sent meanwhile fails it with "the domain was disabled".
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and the command then moves all the
same; after about 10 seconds for a page whose input the browser does not
forward yet, for a target out of view that the page would not scroll to
yet, or with a command waiting with it that the page would not receive
yet. It fails with "the page was not displayed in time", having sent
nothing, when by then the browser does not yet forward the page's input,
the target is out of view and the page would not take the wheel or the
swipe that scrolls to it, or the browser stops drawing before the page is
displayed and the page stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
selector Selector
relativePosition (optional) Coordinate Position within element bounds as ratio [0-1] for each axis.
Default: random position within 0.2-0.8 of bounds.
absoluteOffset (optional) boolean For "coord" selector type only: if true, treat the query coordinates
as an offset from the current mouse position rather than absolute
viewport coordinates. Default: false.
steady (optional) boolean If true, moves along a straighter path and never goes past the target.
Use for small or precise targets where accuracy matters. Default: false.
frameUrl (optional) string URL glob of the frames to look the element up in (e.g.
"*checkout.example.com*"): an element of the page or of another
frame that the selector also matches is left out. The element is
scrolled into view, then reached in page coordinates. Applies to css,
xpath, backendNodeId and pierce selectors: any other type with
frameUrl is refused as invalid params. Default: every frame.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.clickOn

Scrapium

Moves to target then clicks with human-like timing.
On Android, iPhone and iPad a finger taps: the page receives the touch
events of a touch screen, then the mouse events and the click a tap
gives. A right click there is a long press, as is a click held for half a
second or more (clickDuration 0.5 or more): it gives a contextmenu event
and no click. A middle click stays a mouse click.
Supports all selector types except bottom.
While the page, or a frame the command looks in, is still loading its
document (before its DOMContentLoaded event), a css, xpath, pierce or role
target that is not there yet, or has no box yet, is looked for until it is,
those documents have loaded, or about 30 seconds have passed: only then does
the command fail with its lookup's error, "Element not found",
"Element not found in any frame" once it has looked in the page's frames,
"No frames match URL pattern: ..." when no frame matches frameUrl, or for a
role "No AX node found with role=..." or "Element has empty bounds". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a target that is not there fails the
command at once, and a backendNodeId or axNodeId target is looked up once.
Antibot.disable sent meanwhile fails it with "the domain was disabled".
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
selector Selector
relativePosition (optional) Coordinate
button (optional) string Mouse button: "left", "right", or "middle". Default: "left".
clickDuration (optional) number Hold duration in seconds between mousedown and mouseup (between
touchstart and touchend for a tap; on Android, iPhone and iPad half a
second or more is a long press, with no click).
Default: random between 0.1 and 0.4 seconds.
clickCount (optional) integer Number of clicks (e.g. 2 for double-click). Default: 1.
frameUrl (optional) string URL glob of the frames to look the element up in, as for moveTo: the
click lands on the element of a matching frame. Applies to css, xpath,
backendNodeId and pierce selectors: any other type with frameUrl is
refused as invalid params. Default: every frame.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.dragAndDrop

Scrapium

Drag from source to destination with human-like movement.
Supports all selector types except bottom.
While the page, or a frame the command looks in, is still loading its
document (before its DOMContentLoaded event), each of its css, xpath, pierce
or role targets that is not there yet, or has no box yet, is looked for
until it is, those documents have loaded, or about 30 seconds have passed:
only then does the command fail with its lookup's error,
"Element not found", "Element not found in any frame" once it has looked in
the page's frames, or for a role "No AX node found with role=..." or
"Element has empty bounds". A selector that does not parse matches nothing,
and is looked for the same way. Once those documents have loaded, a target
that is not there fails the command at once, and a backendNodeId or axNodeId
target is looked up once. Antibot.disable sent meanwhile fails it with
"the domain was disabled".
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
from Selector
to Selector
fromRelativePosition (optional) Coordinate Position within source element bounds as ratio [0-1]. Default: center area.
toRelativePosition (optional) Coordinate Position within destination element bounds as ratio [0-1]. Default: center area.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.clickAndHold

Scrapium

Moves to target element, presses mouse down, holds for a minimum time,
then releases. For controls that need a long press.
On Android, iPhone and iPad a finger presses: held for half a second or
more, it is a long press, which gives a contextmenu event and no click.
A right button there is always a long press; a middle button stays a
mouse press.
Supports all selector types except bottom.
While the page, or a frame the command looks in, is still loading its
document (before its DOMContentLoaded event), a css, xpath, pierce or role
target that is not there yet, or has no box yet, is looked for until it is,
those documents have loaded, or about 30 seconds have passed: only then does
the command fail with its lookup's error, "Element not found",
"Element not found in any frame" once it has looked in the page's frames,
"No frames match URL pattern: ..." when no frame matches frameUrl, or for a
role "No AX node found with role=..." or "Element has empty bounds". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a target that is not there fails the
command at once, and a backendNodeId or axNodeId target is looked up once.
Antibot.disable sent meanwhile fails it with "the domain was disabled".
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
selector Selector
relativePosition (optional) Coordinate
holdTime (optional) number Minimum hold duration in seconds. Default: random between 1.0 and 3.0.
button (optional) string Mouse button: "left", "right", or "middle". Default: "left".
frameUrl (optional) string Frame URL glob pattern to restrict element search to matching frames.
Uses shell-style wildcards (e.g. "*example.com*", "*/widget/*").
Applies to css, xpath, backendNodeId and pierce selectors: any other
type with frameUrl is refused as invalid params.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.clickAndSlide

Scrapium

Moves to target element, presses mouse down, slides the mouse
to a target position, then releases.
For slider controls.
Supports all selector types except bottom.
While the page, or a frame the command looks in, is still loading its
document (before its DOMContentLoaded event), each of its css, xpath, pierce
or role targets that is not there yet, or has no box yet, is looked for
until it is, those documents have loaded, or about 30 seconds have passed:
only then does the command fail with its lookup's error,
"Element not found", "Element not found in any frame" once it has looked in
the page's frames, "No frames match URL pattern: ..." when no frame matches
frameUrl, or for a role "No AX node found with role=..." or
"Element has empty bounds", after "Failed to resolve target: " or
"Failed to resolve source: " when it slides onto a target. A selector that
does not parse matches nothing, and is looked for the same way. Once those
documents have loaded, a target that is not there fails the command at once,
and a backendNodeId or axNodeId target is looked up once. Antibot.disable
sent meanwhile fails it with "the domain was disabled".

Two modes:
1. Fixed distance: provide "distance" in CSS pixels.
2. Target selector: provide "target" selector. The command slides from
the source to the target, landing near it as a human hand would.
At least one of "distance" or "target" must be provided.
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
selector Selector
relativePosition (optional) Coordinate
distance (optional) number Horizontal slide distance in CSS pixels (positive = right, negative = left).
target (optional) Selector Target element selector: the command slides from "selector" to "target",
landing near it rather than exactly on it.
targetRelativePosition (optional) Coordinate Position within target element bounds as ratio [0-1].
verticalOffset (optional) number Vertical slide offset in CSS pixels. Default: 0 (horizontal only).
button (optional) string Mouse button: "left", "right", or "middle". Default: "left".
frameUrl (optional) string Frame URL glob pattern to restrict element search to matching frames.
Uses shell-style wildcards (e.g. "*example.com*"). Applies to css, xpath,
backendNodeId and pierce selectors, for selector and target: any other
type with frameUrl is refused as invalid params.
overshoot (optional) boolean If true, goes a few pixels past the destination on the X axis, then
comes back to it, as a hand dragging past a slider's end. Default: false.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.scroll

Scrapium

Human-like scroll. Three modes:

1. Element into view: provide selector (css/xpath/axNodeId/coord/role).
Scrolls with mouse wheel steps until the element is near the viewport
center. Does nothing if it is already visible near the center.

2. Scroll to bottom: provide selector {type:"bottom", query:""}.
Scrolls down by part of a viewport height per call: call again until
atBottom. Moves the mouse into the viewport first when it is outside.
Returns atBottom=true when scrollY is within 5px of the maximum scroll
offset.

3. Manual delta: provide delta (no selector). Scrolls by the given pixel
offset in several mouse wheel steps.

On Android, iPhone and iPad a finger swipes instead of the mouse wheel, as
on the device's touch screen: the page receives touch events and no wheel
event, a flick carries the page on with the device's momentum, and the
finger swipes again while the page, or the target, has further to go, up
to eight swipes, stopping once a swipe no longer moves it. A scroll the
page can follow then ends within about 6% of the viewport of the distance
asked for.

On a Mac a trackpad's two-finger swipes scroll instead of a mouse wheel:
the page receives wheel events at the display's frame rate, in whole
pixels, a swipe for about every 900 pixels, up to eight swipes, which share
a longer distance, so a scroll takes about three seconds at most. It stops
before a swipe when the last one moved nothing it scrolls: the target being
brought into view, or the page left where it was at its end.

Supports all selector types including bottom.
In the element mode, while the page, or one of its frames, is still loading
its document (before its DOMContentLoaded event), a css, xpath, pierce or
role target that is not there yet, or has no box yet, is looked for until it
is, those documents have loaded, or about 30 seconds have passed: only then
does the command fail with its lookup's error, "Element not found",
"Element not found in any frame" once it has looked in the page's frames, or
for a role "No AX node found with role=..." or "Element has empty bounds". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a target that is not there fails the
command at once, and a backendNodeId or axNodeId target is looked up once.
Antibot.disable sent meanwhile fails it with "the domain was disabled".
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.

Parameters

Name Type Description
selector (optional) Selector Target element to scroll into view, or {type:"bottom", query:""} to
scroll toward page bottom.
delta (optional) Coordinate Manual scroll delta in CSS viewport pixels. Follows the DOM
window.scrollBy(x, y) convention: positive y = scroll DOWN
(toward the bottom of the page), positive x = scroll RIGHT.
The same on every platform. A delta that is not a finite number, or
beyond 33554432 pixels, fails with "Invalid delta values".

Return Object

Name Type Description
success boolean
errorMessage (optional) string
atBottom (optional) boolean True when the page is at or near the bottom (within 5px of max scroll).
Only set when selector type is "bottom".

Antibot.typeText

Scrapium

Types text character by character with human-like typing speed,
set in words per minute. Each character is sent with the key codes
of the browser's keyboard layout, or on a mobile platform as its
on-screen keyboard enters it.
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced while it waits. Commands that wait start in the order
they are ready to act.

Parameters

Name Type Description
text string
wpm (optional) number Words per minute, a word being five characters. Default: 60.
Typical human range: 30-80. Higher is faster.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.fill

Scrapium

Clicks on element, optionally clears it, then types text with human timing.
On Android, iPhone and iPad the click is a tap, as for clickOn.
Without clear, the text goes after the content already in the field.
Supports all selector types except bottom.
While the page, or a frame the command looks in, is still loading its
document (before its DOMContentLoaded event), a css, xpath, pierce or role
target that is not there yet, or has no box yet, is looked for until it is,
those documents have loaded, or about 30 seconds have passed: only then does
the command fail with its lookup's error, "Element not found",
"Element not found in any frame" once it has looked in the page's frames, or
for a role "No AX node found with role=..." or "Element has empty bounds". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a target that is not there fails the
command at once, and a backendNodeId or axNodeId target is looked up once.
Antibot.disable sent meanwhile fails it with "the domain was disabled".
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
Without clear, once it has clicked, it can still fail: with "the page is
gone" when the page navigates away or crashes right after the click, and
with "the page was not displayed in time" when the browser stops drawing
before the page is displayed and the page stops responding. The click may
have reached the page, the text has not. A success does not prove that
the page kept the text: read the field to know.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
selector Selector
text string
relativePosition (optional) Coordinate
clear (optional) boolean Clear existing content first, as a user does: select all, then
Backspace. The select-all is the select-all shortcut (Cmd+A on macOS,
Ctrl+A elsewhere), except on Android, iPhone and iPad, where it is the
field menu's Select All, which sends no key event; there Backspace is
the on-screen keyboard's, or a keyboard's on a field that shows no
on-screen keyboard. A page that cancels the shortcut's keydown, or the
select-all's selectstart event, gets no select-all, so Backspace deletes
only the character before the caret and the text goes in with the rest
of the content, as from a user; the command still succeeds, so read the
field to know whether it was cleared. The command fails, with an
errorMessage, when the shortcut cannot reach the page, or when the page
is gone before the select-all.
Default: false.
wpm (optional) number Words per minute for typing. Default: 60. See typeText.
paste (optional) boolean Paste the text instead of typing it. When true, the text replaces the
clipboard content and is pasted into the field with the paste shortcut
(Cmd+V on macOS, iPhone and iPad, Ctrl+V elsewhere): the page receives
the shortcut's key events and the paste, beforeinput and input events
of a user paste, with the text in clipboardData while the paste event
is dispatched. On Android, iPhone and iPad, in a field that shows the
on-screen keyboard, the text is pasted from the field's menu instead,
as users of these devices paste, a moment after the click: the page
receives the same paste, beforeinput and input events and no key
event. On Android the menu opens as a user opens it, with a long
press on an empty field or a tap on the caret's handle in a field that
holds text, so the page first receives that gesture's contextmenu
event, and the long press's touch and pointer events. A page that
cancels that contextmenu event, or does not dispatch it within about a
second, gets no menu: the text then goes in as the on-screen
keyboard's clipboard suggestion enters it, as one insertText input
between key events of key code 229, with no paste event, and the
clipboard is left as it was. On iPhone and iPad the text's events
come as long after the paste event as the device takes to read its
clipboard, each read of the paste event's clipboardData taking its
share. A field with inputmode="none" shows no on-screen keyboard and
takes the paste shortcut. A page that cancels the shortcut's keydown,
or the paste event, gets no paste, as from a user; the command still
succeeds, so read the field to know whether the page took it. The
command fails, with an errorMessage, when the page is gone, lost focus
before the shortcut, did not receive it, or did not answer it within
15 seconds; on macOS, iPhone and iPad also when the page lost focus
before it answered the shortcut, or did not finish the paste within 5
seconds of its answer.
A paste from the field's menu fails when the page is gone, lost focus
before the paste, or did not finish it within 5 seconds. On Android,
Antibot.disable or another paste of the same session, sent before the
paste presses the menu's Paste, or the keyboard's clipboard suggestion
on a page that kept the menu shut, ends the paste with its
errorMessage, as does another pointer command sent while the long
press that opens the menu is down.
After a failure the page may still receive the paste, so read the field
before retrying. The clipboard is the browser's, shared by all its
pages: a paste waits while a paste, or a pressKey copy, cut or paste,
of another page, in any tab or frame, is still in progress. Each one
ahead of it takes up to 15 seconds for its page to answer the
shortcut; on macOS, iPhone and iPad up to 5 seconds more for a paste,
or 15 more for a copy or cut, for the page to finish it; up to 7
seconds for a paste from the field's menu; and up to 1 second more
after a copy or cut. Much faster than typing for long strings; useful
for passwords, tokens, or pre-filled data.
Default: false.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.showCursor

Scrapium

Shows a cursor overlay (red dot and trail) for visual debugging.
Stays on across navigations.

The dot is the pointer, so a scroll leaves it under the pointer. The trail,
the click marks, the path preview and the target brackets are places on the
page, so they scroll with it: a path drawn before a scroll moves up with the
content, and the movement after it is drawn where the pointer now is, not
over the old path. A scroll under a still pointer extends the trail, because
the pointer has travelled over the page. This follows the page's own scroll,
not the scroll of an element inside it.

Parameters

Name Type Description
keepHistory (optional) boolean When true, the cursor trail retains its FULL movement history at
constant opacity instead of the default rolling fading trail of about
the last second of movement. This makes a single screenshot show the
entire path the cursor took, not just its current position.
Default: false.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.highlightTarget

Scrapium

Highlights a target element on the debug cursor overlay: four corner
brackets painted around the element's bounding box in a kind-specific
color, auto-expiring after ttlMs. Use it to show what is ABOUT to be
interacted with, so a screencast shows the intent, not just the outcome.

No-op when showCursor hasn't been called for this session: the
brackets are drawn only while the cursor overlay is enabled.

Runs no script in the page and does not change the DOM. Elements out
of the viewport or hidden are still bracketed when their layout box is
not empty, so the brackets may then sit off-screen, where the element is.

Selector types: same set as moveTo (every type except bottom). For
backendNodeId, the query is the integer BackendNodeId as a decimal
string.

With the overlay on, while the page, or one of its frames, is still loading
its document (before its DOMContentLoaded event), a css, xpath, pierce or
role target that is not there yet, or has no box yet, is looked for until it
is, those documents have loaded, or about 30 seconds have passed, as the
command it shows looks for it: only then does the command fail with its
lookup's error, "Element not found", "Element not found in any frame" once
it has looked in the page's frames, or for a role
"No AX node found with role=..." or "Element has empty bounds". It fails
with "the page navigated before the command acted" when the page loads
another document meanwhile, and with "the domain was disabled" when
Antibot.disable comes meanwhile.

With the overlay on, it fails with "the page was not displayed in time"
when the browser stops drawing before the page is displayed and the page
does not answer within about 5 seconds.

Parameters

Name Type Description
selector Selector
kind (optional) string Color kind. Single ASCII character, case-insensitive. Recognized:
"C" — click hint (amber, about-to-act)
"T" — type / fill hint (blue)
"V" — credential fill hint (teal-cyan)
"H" — hover hint (lavender)
"S" — scroll-into-view hint (purple)
"O" — outcome: success (green, post-action flash)
"X" — outcome: failure (red, post-action flash)
Unknown values fall back to amber. Omitted or "" is the hover hint.
ttlMs (optional) integer Time in milliseconds the brackets remain visible before fading.
Default 1500ms. Clamped to [0, 30000]. 0 clears the brackets.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.previewMousePath

Scrapium

Paints a "going there next" preview line on the cursor overlay: a
thin semi-transparent straight segment from the current tracked
cursor position to the target element's center. Use just before
a click or move to show WHERE the cursor is about to travel before
any motion begins.

The line shows the destination only: the move itself follows its
own path.

No-op when showCursor isn't enabled. It can be sent alongside the
click or move without waiting for its response. With the overlay on, it
fails with "the page was not displayed in time" when the browser stops
drawing before the page is displayed and the page does not answer within
about 5 seconds.

With the overlay on, while the page, or one of its frames, is still loading
its document (before its DOMContentLoaded event), a css, xpath, pierce or
role target that is not there yet, or has no box yet, is looked for until it
is, those documents have loaded, or about 30 seconds have passed, as the
command it shows looks for it: only then does the command fail with its
lookup's error, "Element not found", "Element not found in any frame" once
it has looked in the page's frames, or for a role
"No AX node found with role=..." or "Element has empty bounds". It fails
with "the page navigated before the command acted" when the page loads
another document meanwhile, and with "the domain was disabled" when
Antibot.disable comes meanwhile.

Parameters

Name Type Description
selector Selector
ttlMs (optional) integer Time in milliseconds the preview line remains visible before
fading. Should be slightly longer than the expected mouse-move
duration so the line is still visible while the cursor is in
transit. Default 500ms. Clamped to [0, 5000].

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.getFrames

Scrapium

Returns all frames including OOPIFs with their metadata: every frame
in the page, cross-origin out-of-process iframes included.

Return Object

Name Type Description
frames array<FrameInfo>

Antibot.locateElement

Scrapium

Locates an element in a specific frame and returns its bounding box
in main-frame viewport coordinates (CSS pixels). This allows clicking
on elements inside OOPIFs with correct screen-space coordinates.
Only "css", "xpath", and "axNodeId" selector types are supported.
While the frame is still loading its document (before its DOMContentLoaded
event), a css, xpath or pierce target that is not there yet, or has no box
yet, is looked for until it is, the document has loaded, or about 30 seconds
have passed: only then does the command fail with "Element not found". A
selector that does not parse matches nothing, and is looked for the same
way. Once the document has loaded, a target that is not there fails the
command at once, and an axNodeId target is looked up once. It fails with
"Frame not found: <frameId>" when the frame is removed meanwhile, with
"the page navigated before the command acted" when the frame loads another
document meanwhile, and with "the domain was disabled" when Antibot.disable
comes meanwhile.
It fails with "the page was not displayed in time" when the browser stops
drawing before the page is displayed and the page does not answer within
about 5 seconds.

Parameters

Name Type Description
frameId Page.FrameId
selector Selector Only css, xpath, and axNodeId selector types are supported.
relativePosition (optional) Coordinate

Return Object

Name Type Description
success boolean
errorMessage (optional) string
pointX (optional) number Resolved click point in viewport coordinates.
pointY (optional) number
boundsX (optional) number Element bounding box in viewport coordinates.
boundsY (optional) number
boundsWidth (optional) number
boundsHeight (optional) number

Antibot.locateElementAcrossFrames

Scrapium

Locates an element across ALL frames (main + iframes/OOPIFs).
Tries main frame first, then walks child frames until found.
Returns bounding box in main-frame CSS viewport coordinates.
Supports css, xpath, axNodeId, coord, and role selector types (not bottom).
While the page, or one of its frames, is still loading its document (before
its DOMContentLoaded event), a css, xpath or role target that is not in any
frame yet, or has no box yet, is looked for until it is, those documents
have loaded, or about 30 seconds have passed: only then does the command
fail with its lookup's error, "Element not found",
"Element not found in any frame" once it has looked in the page's frames, or
for a role "No AX node found with role=..." or "Element has empty bounds". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a target that is not there fails the
command at once, and an axNodeId target is looked up once. It fails with
"the page navigated before the command acted" when the page loads another
document meanwhile, and with "the domain was disabled" when Antibot.disable
comes meanwhile.
It fails with "the page was not displayed in time" when the browser stops
drawing before the page is displayed and the page does not answer within
about 5 seconds.

Parameters

Name Type Description
selector Selector Supports css, xpath, axNodeId, coord, and role types. Not bottom.
relativePosition (optional) Coordinate

Return Object

Name Type Description
success boolean
errorMessage (optional) string
pointX (optional) number
pointY (optional) number
boundsX (optional) number
boundsY (optional) number
boundsWidth (optional) number
boundsHeight (optional) number

Antibot.waitForElement

Scrapium

Waits for a selector to appear in any frame (main + iframes/OOPIFs), or to
stop matching with hidden. Checks repeatedly until the timeout and runs no
script in the page. At the timeout it answers success false with
"Timeout waiting for element", also when the page is busy or held by a
dialog and has not answered a check. Searches main frame first, then child
frames each time.
A frame removed while it is asked, and a css selector that does not parse,
match nothing. It fails with "the page was not displayed in time" when the
browser stops drawing before the page is displayed and the page does not
answer within about 5 seconds, which says nothing of the element.
With hidden, while the page, or a frame it searches, is still loading its
document (before its DOMContentLoaded event), a css, xpath, pierce or role
selector that has not matched yet does not count as hidden: the wait goes on
until it has matched and stopped matching, or those documents have loaded.
Supports css, xpath, axNodeId, backendNodeId, coord, role and pierce
selector types (not bottom).

Parameters

Name Type Description
selector Selector
timeout (optional) integer Timeout in milliseconds. Default: 10000 (10s).
visible (optional) boolean If true, also checks that the element has non-zero bounding box
dimensions (width > 0 and height > 0). Note: does NOT check CSS
visibility, display, or opacity properties.
Default: false (just checks existence in the DOM).
frameUrl (optional) string URL glob of the frames to search, e.g. "*checkout.example.com*".
Applies to css, xpath, backendNodeId and pierce: any other type with
frameUrl is refused as invalid params. No frame matching counts as no
match. Default: every frame.
hidden (optional) boolean If true, answers once the selector stops matching (with visible, once
the match has no box) instead of once it matches. Default: false.

Return Object

Name Type Description
success boolean
errorMessage (optional) string
frameId (optional) Page.FrameId Reserved for future use. Currently always null.

Antibot.waitForCookie

Scrapium

Waits for a cookie to be written: answers once a cookie of that name the jar
sends to url holds a value other than previousValue (any value when it is
omitted), written by a script (document.cookie, CookieStore) or by a
response's Set-Cookie. The cookies are those whose domain, path and Secure
attribute match url, whatever their SameSite attribute and the browser's
cookie settings: the unpartitioned ones and, set with the Partitioned
attribute, those of the partition a request of the frame the command was
sent to would send to url from, as that frame is when the command arrives.
Read from the page's cookie jar: nothing runs in the page, which sees
nothing of the wait.

No write is missed, whatever its order against the command: a write made
before the command is found in the jar (alreadyWritten), and one made after
it is reported as it happens. A timeout is an answer, written false, not an
error.

Parameters

Name Type Description
name string Cookie name.
url string The URL the cookie is sent to: its domain, path and scheme pick the
cookies as for a request to it (a secure one needs https, or a URL the
browser treats as secure, such as localhost).
previousValue (optional) string The value the cookie held before the write waited for. A jar that holds
another one already answers at once.
timeout (optional) integer Timeout in milliseconds. Default: 10000 (10s).

Return Object

Name Type Description
written boolean True once the cookie is written, false when the timeout passed first.
value (optional) string The value written. Set when written.
alreadyWritten (optional) boolean True when the jar held it as the command arrived: the write came before
the command. Set when written.

Antibot.getMousePosition

Scrapium

Returns the current tracked mouse position in CSS viewport pixels. In a
tab where no command has moved the mouse yet, the point its first move
starts from: where the mouse pointer of the browser's display rests, moved
inside the viewport when it is outside, or, with no pointer (a headless
browser, or on Android, iPhone and iPad), a point in the middle of the
viewport.

Return Object

Name Type Description
x number
y number

Antibot.isElementVisible

Scrapium

Checks whether an element is visible in the viewport.
Only "css" and "xpath" selector types are supported.
Searches main frame first, then child frames (iframes/OOPIFs).
Visibility checks display, opacity, dimensions, and viewport
intersection.

Parameters

Name Type Description
selector Selector Only css and xpath selector types are supported.

Return Object

Name Type Description
visible boolean
exists (optional) boolean True if element exists in the DOM but is hidden (not visible).
reason (optional) string Human-readable reason when not visible (e.g. "zero size", "off viewport");
"selector did not parse" for a css selector that does not parse; "the page
is gone" when the page went before it answered.

Antibot.isFocused

Scrapium

Checks whether the currently focused element matches the selector.
Only "css" and "xpath" selector types are supported. Searches the
main frame first, then iframes/OOPIFs — focus may be inside an OOPIF.
Useful as a pre-flight check before sending keystrokes to the
focused element, e.g. to confirm a password field still has focus
before typing into it.

Parameters

Name Type Description
selector Selector Only css and xpath selector types are supported.

Return Object

Name Type Description
focused boolean True iff `document.activeElement` (or the focused element in
one of the iframes) matches the selector.
reason (optional) string Human-readable reason when not focused (e.g. "no active element",
"focused element does not match selector"; "the page is gone" when the page
went before it answered).

Antibot.pressKey

Scrapium

Sends a single key press with human-like timing (keyDown, then keyUp
a short moment later).

Special key names (case-insensitive):
"Enter", "Tab", "Escape" (or "Esc"), "Backspace", "Delete",
"Space", "Home", "End", "PageUp", "PageDown",
"ArrowUp" (or "Up"), "ArrowDown" (or "Down"),
"ArrowLeft" (or "Left"), "ArrowRight" (or "Right")

Single characters: any single character (e.g. "a", "A", "1", "@").
Shift, and AltGr, are applied automatically when the character requires
them on the profile's keyboard layout.

Modifier combos: prefix with "Ctrl+", "Shift+", "Alt+", or "Meta+"
(case-insensitive). One modifier prefix per call. The modifier key is
pressed a moment before the key and released after it, as a user does.
"Shift+" types the key's shifted character ("Shift+a" types "A"). A
modifier other than Shift with a character that needs AltGr fails. On
Android, a "Meta+" combo sends no key event: the platform keeps it for
its own shortcuts.
On macOS, iPhone and iPad, "Meta+a", "Meta+c", "Meta+x", "Meta+v" and
"Meta+z" select all, copy, cut, paste and undo, and "Meta+Z" redoes, as
the Edit menu does; the command fails, with an errorMessage, when the
shortcut cannot reach the page.
The copy, cut and paste shortcuts use the browser's clipboard, shared by
all its pages: "Ctrl+c" (copy), "Ctrl+x" and "Shift+Delete" (cut),
"Ctrl+v" and "Ctrl+V" (paste, and paste matching the style), and on
macOS, iPhone and iPad also "Meta+c", "Meta+x" and "Meta+v". The key
waits, with the modifier held, while a paste or another such shortcut of
a page, in any tab or frame, is still in progress. Each one ahead of it
takes up to 15 seconds for its page to answer the shortcut; on macOS,
iPhone and iPad up to 5 seconds more for a paste, or 15 more for a copy
or cut, for the page to finish it; and up to 1 second more after a copy
or cut. On macOS, iPhone and iPad, "Meta+v" also fails when the page did
not finish the paste within 5 seconds of its answer, and "Meta+c" and
"Meta+x" when it did not finish the copy or cut within 15 seconds of it.
Examples: "Ctrl+a", "Ctrl+c", "Ctrl+v", "Shift+Tab", "Meta+a"
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced while it waits. Commands that wait start in the order
they are ready to act.

Parameters

Name Type Description
key string Key name, single character, or modifier combo. See above for accepted values.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.hover

Scrapium

Moves mouse to element with human-like trajectory and pauses
briefly to trigger hover states (CSS :hover, tooltips, menus).
On Android, iPhone and iPad there is no pointer to hover with: the
finger moves above the screen and the page receives no event for the move.
A target out of view is first scrolled to with a finger's swipe, whose
touch events the page receives.
Supports all selector types except bottom.
While the page, or a frame the command looks in, is still loading its
document (before its DOMContentLoaded event), a css, xpath, pierce or role
target that is not there yet, or has no box yet, is looked for until it is,
those documents have loaded, or about 30 seconds have passed: only then does
the command fail with its lookup's error, "Element not found",
"Element not found in any frame" once it has looked in the page's frames, or
for a role "No AX node found with role=..." or "Element has empty bounds". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a target that is not there fails the
command at once, and a backendNodeId or axNodeId target is looked up once.
Antibot.disable sent meanwhile fails it with "the domain was disabled".
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and the command then moves all the
same; after about 10 seconds for a page whose input the browser does not
forward yet, for a target out of view that the page would not scroll to
yet, or with a command waiting with it that the page would not receive
yet. It fails with "the page was not displayed in time", having sent
nothing, when by then the browser does not yet forward the page's input,
the target is out of view and the page would not take the wheel or the
swipe that scrolls to it, or the browser stops drawing before the page is
displayed and the page stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
selector Selector
relativePosition (optional) Coordinate
holdTime (optional) integer How long to hold the hover position in milliseconds.
Default: random between 500 and 1500ms.

Return Object

Name Type Description
success boolean
errorMessage (optional) string

Antibot.selectOption

Scrapium

Selects an option in a <select> or custom dropdown.
Only "css" and "xpath" selector types are supported. The selector is
looked for in the page's frames as clickOn looks for it, the main frame
first.

For native <select>: the option is found in that select by exact
comparison, and nothing is clicked when the select or the option is not
found ("Element not found", "Element is not a <select>", "Option not
found"). A dropdown is clicked open, then the option is clicked in the
list it opens. A list box (a <select> with a size above 1, or multiple)
shows its options in the page: the option is clicked where the list
shows it, after scrolling the list to it with the mouse wheel (a finger's
swipe on Android, iPhone and iPad) when it is
out of the list's view, and the list box gets no other click ("the
option is not displayed" for a hidden option, "the option could not be
scrolled into view" when the wheel does not bring it into view). A
dropdown that opens no list on its click, or whose list cannot be aimed
at (more than 20 options, which it scrolls), gets no other click: the
list is closed and the option selected without one. Fires change/input
events.

While the page, or one of its frames, is still loading its document (before
its DOMContentLoaded event), the element the selector names, or the option
of a <select>, that is not there yet, or has no box yet, is looked for until
it is, those documents have loaded, or about 30 seconds have passed: only
then does the command fail with "Element not found" or "Option not found". A
selector that does not parse matches nothing, and is looked for the same
way. Once those documents have loaded, a select or an option that is not
there fails the command at once. Antibot.disable sent meanwhile fails it
with "the domain was disabled".

For custom dropdowns (Bootstrap, React Select, MUI, etc.): provide
optionSelector — the command will click the trigger to open the dropdown,
find the matching option element, and click it.

Matching: provide exactly one of value, text, or index.
For native <select>:
- "value" matches the <option> value attribute
- "text" matches the <option> text content (whitespace-stripped)
- "index" matches by 0-based position among the select's options,
hidden ones included
For custom dropdowns with optionSelector (the trigger is not a <select>),
among the elements matching optionSelector that have a box and are not
visibility:hidden:
- "text" matches the first whose textContent (whitespace-stripped)
equals it
- "index" matches by 0-based position among them, in document order
The match is clicked only where a click at its position reaches it (no
other element over it, not clipped by its list, inside its frame's
viewport); otherwise it counts as not found.
- With neither, the first element matching optionSelector is clicked,
for a selector that already includes an attribute filter
(e.g. ".dropdown-item[data-value='US']"); "value" is ignored there
Acts once the page is displayed and takes input: sent right after a
navigation, it waits for that, then pauses briefly as a person would;
the wait for the page gives up after about 5 seconds, counted from the
first of the commands waiting for it, and after about 10 seconds for a
page that would not receive the command's input yet. It fails with "the
page was not displayed in time", having sent nothing, when the page is
still not displayed then and would not receive the command's input, or
when the browser stops drawing before the page is displayed and the page
stops responding. It fails with
"the page navigated before the command acted" when the page it was sent
to is replaced before the command acts on it. Commands that wait start
in the order they are ready to act.
Once its pointer has moved or pressed, it can still fail with "the page
was not displayed in time" when the browser stops drawing before the
page is displayed and the page stops responding: its presses may have
reached the page and selected an option, so read the page to know which
option is selected.
When pointer commands overlap, one whose mouse movement another one
cuts short fails with "Another pointer command replaced this one before
it finished": send pointer commands one after the other.

Parameters

Name Type Description
selector Selector Only css and xpath selector types are supported.
value (optional) string Select by option value attribute, compared exactly. Native <select>
only.
text (optional) string Select by visible text content (whitespace-stripped comparison).
index (optional) integer Select by 0-based index among options.
optionSelector (optional) string CSS selector for option elements in a custom dropdown. With value,
text or index, it is used when the selector names an element that is
not a <select>; without them, whatever the selector names. An empty
one is ignored.
When provided, triggers click-based selection flow:
1. Click the trigger element (selector) to open the dropdown
2. Wait for elements matching optionSelector to appear in the DOM
("Option not found in dropdown" after about 2 seconds)
3. Find the option matching text/index as described above, or click
the first match if the selector already includes an attribute
filter
4. Click the matching option element
Examples: ".dropdown-item", "[role=option]", "li[data-value='US']"

Return Object

Name Type Description
success boolean
errorMessage (optional) string
selectedValue (optional) string The value of the option that ended up selected — the option's own
value, NOT the value/text/index the call was made with. For a text or
index lookup those differ.
selectedText (optional) string The text of the selected option.

Antibot.captchaEnable

Scrapium

Enables automatic captcha detection AND solving. While enabled, the
browser emits captchaDetected for each challenge it recognizes on the
pages it loads, then solves it right away, one captcha at a time.
Clients observe progress via the
captchaSolvingStarted / captchaSolved / captchaError events. No-op
if already enabled. Disable with captchaDisable.
After 20 automatic solve attempts, detection and solving stop for the
session and a captchaError says so; calling captchaEnable again turns
them back on with a new count.

Antibot.captchaDisable

Scrapium

Disables captcha detection. The session history of detected captchas
(and their solve/error outcomes) is preserved — retrieve it with
getSolvedCaptchas. A solve under way is stopped. Events already in
flight (from captchaEnable) may still arrive.

Antibot.getSolvedCaptchas

Scrapium

Returns the full list of captchas seen this session, including ones
that failed and ones still pending. Kept after captchaDisable, so it
can still be read before the session ends.

Return Object

Name Type Description
records array<CaptchaRecord>

Antibot.solveCaptcha

Scrapium

Requests the browser to solve a previously detected captcha. Needs
captchaEnable first. Refused for an unknown detectionId, one already
solved or failed, and while another solve is in progress. Answers once
the solve ends, with the outcome captchaSolved carries, or fails with
the reason captchaError carries.

A captcha that cannot be solved at the moment ends in captchaError.
Without detectionId, a funcaptcha detection whose challenge Arkose has
not shown is skipped: a pass without a challenge resolves it on its own.

A datadome detection always ends in captchaError (see CaptchaType).

Parameters

Name Type Description
detectionId (optional) string detectionId from a prior captchaDetected event. If omitted the
browser picks up the most recent unsolved detection.
timeout (optional) integer Seconds the solve may take (default 120). Clamped to [20, 600]. A
challenge answered in several rounds gets this time for each round;
some types end sooner under a limit of their own.

Return Object

Name Type Description
detectionId string
type CaptchaType
method string
token (optional) string

Antibot.disable

Scrapium

Disables the Antibot domain.

Events

Antibot.captchaDetected

Scrapium

Emitted when the browser detects a captcha challenge on the page
(Turnstile widget, DataDome slider/interstitial, reCAPTCHA, GeeTest...).
Once captchaEnable has been called, the browser solves the challenge on
its own and emits captchaSolvingStarted, then captchaSolved (or
captchaError on failure): the client does not need to call
solveCaptcha. solveCaptcha remains available to trigger a solve again.

Parameters

Name Type Description
detectionId string Identifier the client passes back to solveCaptcha.
type CaptchaType
frameUrl string URL of the frame the captcha was detected in (may be an OOPIF).
siteKey (optional) string Site key (Turnstile, reCAPTCHA, Puzzle Click) or Arkose public key.
captchaUrl (optional) string Challenge URL for types that need it (DataDome captcha delivery URL,
Arkose service URL).

Antibot.captchaSolvingStarted

Scrapium

Emitted when the browser starts solving a captcha. Useful for UI spinners
/ timing instrumentation on the client side.

Parameters

Name Type Description
detectionId string
type CaptchaType
method string How the browser will solve: "slider" | "checkbox" | "managed" |
"hold" | "token" | "coords" | "rotate" | "invisible" | "cleared".

Antibot.captchaSolved

Scrapium

Emitted when a captcha is solved. For methods slider, checkbox, managed,
hold and rotate the token field is empty; for "token" it contains the
response token; for "coords" it contains the response token the captcha
wrote into the page once it accepted the answer, or none when the page
took the token and navigated before it was read.
"invisible" means Arkose let the browser through without showing a
challenge; the token is then Arkose's session
token. "cleared" means the challenge left with its page before the
browser answered it: the client navigated away, or the site let the
browser through on its own. The page that replaced it showed no
challenge, so nothing was solved; captchaSolvingStarted went out just
before, with the same method unless the solve had already begun.

Parameters

Name Type Description
detectionId string
type CaptchaType
method string How the captcha was solved: "slider" | "checkbox" | "managed" |
"hold" | "token" | "coords" | "rotate" | "invisible" | "cleared".
token (optional) string Response token for "token", the captcha's own response token for
"coords", Arkose's session token for "invisible". Missing for
the other methods (slider, checkbox, managed, hold, rotate, cleared).

Antibot.captchaError

Scrapium

Emitted when a captcha cannot be solved (timeout, solving unavailable,
challenge not supported, challenge element not found, etc.).

Parameters

Name Type Description
detectionId string
type CaptchaType
errorMessage string Human-readable failure reason. It says whether a retry is worth it or
a new session should be started instead.

Types

SelectorType

(string) Scrapium

How to locate an element. Not all commands support all types;
see each command's documentation for supported selector types.

Allowed Values

  • css
  • xpath
  • axNodeId
  • backendNodeId
  • coord
  • role
  • pierce
  • bottom

Selector

(object) Scrapium

Element selector — a type + query pair.
The query format depends on the type:
css — CSS selector, e.g. "#btn", "input[name='email']"
xpath — XPath expression, e.g. "//div[@id='main']"
axNodeId — integer AX node ID of a node backed by an element, as string, e.g. "42"
coord — "x,y" comma-separated CSS viewport pixels, e.g. "450,600"
role — AX role name (case-insensitive), e.g. "checkbox", "button"
pierce — host css >>> css, through shadow roots, e.g. "my-widget >>> [role=button]"
bottom — no query needed (pass ""). Only valid for scroll.
Not all commands support all selector types; see each command's docs.

Properties

Name Type Description
type SelectorType
query string

Coordinate

(object) Scrapium

A point in CSS viewport pixels.

Properties

Name Type Description
x number
y number

Rect

(object) Scrapium

A rectangle in CSS viewport pixels.

Properties

Name Type Description
x number
y number
width number
height number

FrameInfo

(object) Scrapium

Frame metadata returned by getFrames.

Properties

Name Type Description
frameId Page.FrameId
url string
origin string
frameName string
isMainFrame boolean Whether this is the main frame.
isOopif boolean Whether this frame is an out-of-process iframe (OOPIF).

CaptchaType

(string) Scrapium

--- Captcha detection & solving ---

Captcha challenge type surfaced by captchaDetected / captchaSolved /
captchaError events. New types are added over time.

Allowed Values

  • turnstile_checkbox
  • turnstile
  • datadome_slider
  • datadome
  • recaptcha
  • geetest
  • puzzle_click
  • perimeterx_hold
  • aws_waf
  • cs_captcha_rotation
  • funcaptcha

CaptchaRecord

(object) Scrapium

Per-detection record returned by getSolvedCaptchas.

Properties

Name Type Description
detectionId string UUID assigned by captchaDetected.
type CaptchaType
frameUrl string URL of the frame the captcha was detected in. Challenges that render
inline in the host document have no frame of their own, so they carry
a `<scheme>:<page-url>` value instead, with a scheme of its own per
challenge.
Clients that parse this as a URL must tolerate those.
status string "solved" | "failed" | "pending" — reflects the final state the
browser reached for this detection at the time of the call.
detectedAt number Unix-ms timestamp when captchaDetected fired for this record.
method (optional) string How the captcha was solved (or attempted), as in captchaSolved:
one of: "slider" | "checkbox" | "managed" | "hold" | "token" |
"coords" | "rotate" | "invisible" | "cleared". Empty string while
pending.
resolvedAt (optional) number Unix-ms timestamp when the record transitioned to solved/failed.
Unset while pending.
errorMessage (optional) string Populated when status == "failed": the same reason the captchaError
event carried.

Summary