cdp_execute
Execute JavaScript directly in browser page contexts to automate interactions, manipulate DOM elements, or retrieve dynamic content during web automation sessions.
Instructions
Execute JavaScript in the page context.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>"
},
"name": "cdp_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | JavaScript to execute | |
| frame_id | No | Execute in specific frame (from cdp_list_frames) |