firecrawl_browser_execute
Execute browser automation code to navigate pages, click elements, extract data, and run multi-step workflows using bash, Python, or JavaScript commands in an active browser session.
Instructions
Execute code in a browser session. Supports agent-browser commands (bash), Python, or JavaScript.
Best for: Browser automation, navigating pages, clicking elements, extracting data, multi-step browser workflows. Requires: An active browser session (create one with firecrawl_browser_create first).
Arguments:
sessionId: The browser session ID (required)
code: The code to execute (required)
language: "bash", "python", or "node" (optional, defaults to "bash")
Recommended: Use bash with agent-browser commands (pre-installed in every sandbox):
Common agent-browser commands:
agent-browser open <url>— Navigate to URLagent-browser snapshot— Get accessibility tree with clickable refs (for AI)agent-browser snapshot -i -c— Interactive elements only, compactagent-browser click @e5— Click element by ref from snapshotagent-browser type @e3 "text"— Type into elementagent-browser fill @e3 "text"— Clear and fill elementagent-browser get text @e1— Get text contentagent-browser get title— Get page titleagent-browser get url— Get current URLagent-browser screenshot [path]— Take screenshotagent-browser scroll down— Scroll pageagent-browser wait 2000— Wait 2 secondsagent-browser --help— Full command reference
For Playwright scripting, use Python (has proper async/await support):
Note: Prefer bash (agent-browser) or Python. Returns: Execution result including stdout, stderr, and exit code.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | ||
| code | Yes | ||
| language | No |