Browser Actions
There are five types of Bytebot BrowserAction types. These can be split into two categories: void actions (Click, AssignAttribute) which generated by Bytebot’s Act function and extract actions (CopyText, CopyAttribute, ExtractTable) which are generated by Bytebot’s Extract function. The actions vary in complexity.
Click Action
A Click action is executes clicking on a page element. It features two attributes:
type
:“Click”
(constant)xpath
: a xpathstring
that points to a specific element.
When executed, this action will always return null
.
CopyText Action
A CopyText action executes a read on an element’s innerText. It features two attributes:
type
:“CopyText”
(constant)xpath
: a xpathstring
that points to a specific element.
When executed, the action will return a string. If the text content of the element is empty, it will return null
.
CopyAttribute Action
A CopyAttribute action executes a read on a specific element’s attribute. It features three attributes:
type
:“CopyAttribute”
(constant)xpath
: a xpathstring
that points to a specific element.attribute
: astring
that specifies the targeted attribute
When executed, the action will return a string. If the attribute of the element is undefined, it will return null
.
AssignAttribute Action
An AssignAttribute action executes a write operation on a specific element’s specified attribute. It is the only browser action that writes content. The AssignAttribute action includes five attributes:
type
:“AssignAttribute”
(constant)xpath
: a xpathstring
that points to a specific element.attribute
: astring
that specifies the targeted attributevalue
: the value that an attribute is set
When executed, this action will always return null
.
ExtractTable Action
An ExtractTable action executes a read operation on multiple elements that may have columnized data. ExtractTable is used to create an array of listed content The ExtractTable action includes three attributes:
type
:“AssignAttribute”
(constant)xpath
: a xpathstring
that points to a specific element.rows
: anarray
of column objects, each with a name (string
) and an action (BrowserAction
).
When executed, this action will return an array of Record<string,string|null>
.