Skip to content

Evaluate JS

Type: page-evaluate  ·  Package: Browser v1.0.0  ·  Output: object

Executes JavaScript code within the context of the page and returns the result. It is an advanced activity: it gives you direct access to the DOM and the page’s APIs for cases that the other activities do not cover — reading a calculated value, manipulating a difficult element, or invoking a function on the page itself.

Run the script on the page. It can be an expression (document.title) or a function that receives an argument ((arg) => arg.value * 2), in which case the value of the arg parameter is passed to it. Returns whatever the script returns.

ParameterEditorDescription
scriptmultiline textJavaScript expression or function body. Ex: document.title or (arg) => arg.value * 2.
ParameterEditorDescription
pagesessionThe page session. Omit it inside a body; outside, pass = page.
argexpressionArgument passed to the script if the script is a function.

Returns a object with the value returned by the script (text, number, list, etc.).

Page Evaluate script = "document.title" → output: titulo
Page Evaluate
script = "() => Array.from(document.querySelectorAll('.precio')).map(e => e.innerText)"
→ output: precios
  • Get Text / Get Attribute — simple and recommended options for reading data.
  • Click — standard interaction without the need for JavaScript.