Skip to main content
Useful for extracting structured data from a page without LLM processing. The code is evaluated as a JavaScript expression. For simple cases use a single expression. For multi-statement logic, use an IIFE (Immediately Invoked Function Expression): (() => { /* statements */ return result; })() You will not get any output from console.log(), so simply use the return value if your goal is to gather information Example:
session.execute(type="evaluate_js", code="document.title")
session.execute(type="evaluate_js", code="Array.from(document.querySelectorAll('a')).map(a => a.href)")
session.execute(type="evaluate_js", code="(() => { const els = document.querySelectorAll('a'); return els.length; })()")

Fields

type
Literal['evaluate_js']
default:"evaluate_js"
category
str
default:"Special Browser Actions"
description
str
code
str
required
The JavaScript code to evaluate on the page. Use a single expression or an IIFE for multi-statement code.

Module

notte_core.actions.actions