zenrows browser commands for scripts and terminal agents.
Uses: Browser through the MCP browser tools and the zenrows browser CLI command
Ask your AI agent
With the Zenrows MCP server connected, paste any of these prompts. Each one describes the steps, the data to return and the cleanup in plain words, and your agent picks the browser tools on its own. Log in and read a protected page:How the assistant uses the tools
The assistant chains the browser tools in order. A login request, for example, runs as:1
Open a session
browser_navigate opens the URL in a new Zenrows Browser session and returns a session_id. It also takes proxy_country or proxy_region.2
Act on the page
browser_fill types the email and password, and browser_press_key presses Enter. browser_click, browser_select_option and browser_scroll cover the rest of a flow.3
Wait and read
browser_wait_for_selector waits for the dashboard, then browser_get_text, browser_get_cookies or browser_screenshot return what you asked for.4
Close
browser_close ends the session and frees its concurrency slot.Run the same flow from the terminal
The CLI exposes each step as a command.open prints a session ID that every other command takes with --session.
CLI
--json to any command for structured output, for example zenrows browser open <url> --json returns session_id, title, finalUrl and expires_at, which is how the script above reads the session ID with jq. Install the CLI with npm install -g @zenrows/cli, see the CLI guide.
Example output
The MCP login flow, tool by tool:Customize it
Troubleshooting
- The assistant does not offer browser tools: the MCP server is not connected in this client. Follow Connect your AI agent to Zenrows and restart the client.
- A step fails with “element not found”: the page was still loading. Ask the assistant to wait for the element first (
browser_wait_for_selector), or runwait-for-selectorin the CLI. zenrows browser openreports a navigation error: the target URL didn’t load. Close the session with the ID in the error, check the URL, and runopenagain.- Sessions stay open after a conversation: the prompt did not ask to close them. End prompts with “close the browser session when you finish”. Sessions the CLI and MCP tools open also end on their own at the
expires_attime thatzenrows browser open --jsonreturns.
Related recipes
Connect your AI agent to Zenrows
Set up the MCP server in Claude, Cursor or VS Code.
Prompts that put Zenrows MCP to work
Ready-made prompts for Fetch, Extract, Crawl, Batch and Browser.
Build a browser agent with Zenrows
Let Claude or GPT drive the browser with the Zenrows tools.
Automate scraping from your terminal with the CLI
Chain fetch, extract, batch and browser commands in scripts.