evaluate
Execute JavaScript in the page context to access Shadow DOM, iframe content, hidden data, and trigger events that standard selectors cannot reach.
Instructions
Run JavaScript in the page context and return the result.
Use this to handle situations standard selectors can't reach:
Shadow DOM: document.querySelector('my-el').shadowRoot.querySelector('input')
Iframes: document.querySelector('iframe').contentDocument.querySelector('p')
Hidden data: window.INITIAL_DATA or JSON.parse(document.getElementById('NEXT_DATA').textContent)
Visibility checks: document.querySelector('.modal')?.getBoundingClientRect()
Triggering events: document.querySelector('input').dispatchEvent(new Event('focus'))
Args: js: JavaScript expression to evaluate. The return value is JSON-serialised and included in the response. Keep expressions simple — complex logic is better split across multiple calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |