> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zenrows.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> The Zenrows API (Fetch, Extract via extract=auto, and Batch) is described in OpenAPI 3.1 at https://www.zenrows.com/openapi.json and listed in the RFC 9727 API catalog at https://www.zenrows.com/.well-known/api-catalog. Use the spec for exact parameter names and types.

# Let your AI assistant browse with Browser tools

> Let Claude, Cursor or any AI assistant click, type and read in Zenrows Browser from a chat, or run the same steps from the terminal.

Give your AI assistant a real browser. With the Zenrows MCP server connected, Claude, Cursor or any MCP client can open pages in Zenrows Browser, the browser for agents, then click, type, read, take screenshots and close the session, all from a plain-language request. The same steps are available as `zenrows browser` commands for scripts and terminal agents.

**Uses:** [Browser](/browser-sessions/introduction) through the [MCP browser tools](/mcp/tool-reference) and the [`zenrows browser`](/cli/browser/introduction) CLI command

## Ask your AI agent

With the [Zenrows MCP server](/mcp/overview) 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:

```text theme={"dark"}
Use the Zenrows browser to log in at https://www.scrapingcourse.com/login with email
admin@example.com and password password. When the dashboard loads, tell me the first
product name, take a screenshot of the product grid, then close the browser session.
```

Search a site and compare results:

```text theme={"dark"}
Use the Zenrows browser to open https://www.scrapingcourse.com/ecommerce/, search for
"hoodie", and tell me how many results there are. Open the first result and give me
its name, price and available sizes. Close the browser session when you finish.
```

Fill a form and confirm it worked:

```text theme={"dark"}
Use the Zenrows browser to open
https://www.scrapingcourse.com/ecommerce/product/abominable-hoodie/, choose size M and
color Blue, set the quantity to 2, click "Add to cart", and tell me the confirmation
message. Then close the session.
```

Browse as a visitor from another country:

```text theme={"dark"}
Use the Zenrows browser to open https://httpbin.io/ip as a visitor from Germany and tell me
which IP the site sees. Close the session afterwards.
```

## How the assistant uses the tools

The assistant chains the browser tools in order. A login request, for example, runs as:

<Steps>
  <Step title="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`.
  </Step>

  <Step title="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.
  </Step>

  <Step title="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.
  </Step>

  <Step title="Close">
    `browser_close` ends the session and frees its concurrency slot.
  </Step>
</Steps>

Ask for the close step in your prompt: it ends billing as soon as the task is done.

## 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`.

```bash CLI theme={"dark"}
# Open a session and keep its ID
SESSION=$(zenrows browser open https://www.scrapingcourse.com/ecommerce/ --json | jq -r .session_id)

# Search the catalog
zenrows browser fill --session $SESSION --selector "#woocommerce-product-search-field-0" --value "hoodie"
zenrows browser press-key --session $SESSION --key Enter
zenrows browser wait-for-selector --session $SESSION --selector "li.product"
zenrows browser get-text --session $SESSION --selector ".woocommerce-result-count"

# Open the first result, read it and capture it
zenrows browser click --session $SESSION --selector "li.product a"
zenrows browser get-text --session $SESSION --selector "h1.product_title"
zenrows browser screenshot --session $SESSION --out product.png

# Always close the session
zenrows browser close --session $SESSION
```

Add `--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](/cli/introduction).

## Example output

The MCP login flow, tool by tool:

```text theme={"dark"}
browser_navigate         → {"session_id": "8562d040-...", "url": "https://www.scrapingcourse.com/login",
                            "title": "Login Challenge to Learn Web Scraping - ScrapingCourse.com"}
browser_fill (#email)    → {"ok": true}
browser_fill (#password) → {"ok": true}
browser_press_key Enter  → {"ok": true}
browser_wait_for_selector #product-grid → {"ok": true}
browser_get_text .product-name → Chaz Kangeroo Hoodie
browser_get_cookies      → AWSALBCORS, _ga, AWSALB, scrapingcoursecom_session, _ga_NZGD14H87G, XSRF-TOKEN
browser_close            → {"ok": true}
```

The CLI flow (trimmed):

```text theme={"dark"}
✓ Session bb15ec60-a544-494f-8328-1ae88ffdbe4d · "Ecommerce Test Site to Learn Web Scraping – ScrapingCourse.com" · expires 2026-10-14T23:49:48Z · run r-d5f24dc7
Showing 1–16 of 19 results
Eos V-Neck Hoodie
✓ Wrote 109647 bytes → product.png
✓ Closed session bb15ec60-a544-494f-8328-1ae88ffdbe4d.
```

## Customize it

| Change | How |
| - | - |
| Browse from a country | Ask for "proxy country US", or `zenrows browser open <url> --proxy-country us` |
| Browse from a world region | Ask for "proxy region EU", or `--proxy-region eu` |
| Save the page as PDF | Ask for a PDF (`browser_generate_pdf`), or `zenrows browser pdf --session $SESSION --out page.pdf` |
| Run JavaScript on the page | `browser_evaluate`, or `zenrows browser evaluate --session $SESSION --script "document.title"` |
| Reuse a login | `browser_get_cookies` then `browser_set_cookies` in the next session, or `zenrows browser cookies` / `set-cookies` |
| Drive the browser from your own code | Print the WebSocket URL with `zenrows browser connect`, see [Connect Playwright or Puppeteer](/academy/browser/connect-playwright-and-puppeteer) |
| Read a page without a browser | Ask the assistant to "read the page with Zenrows" (the `scrape` tool), see [Turn any web page into LLM-ready markdown](/academy/fetch/markdown-for-llms) |

## Troubleshooting

* **The assistant does not offer browser tools**: the MCP server is not connected in this client. Follow [Connect your AI agent to Zenrows](/academy/connect-your-ai-agent) 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 run `wait-for-selector` in the CLI.
* **`zenrows browser open` reports a navigation error**: the target URL didn't load. Close the session with the ID in the error, check the URL, and run `open` again.
* **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_at` time that `zenrows browser open --json` returns.

## Related recipes

<CardGroup cols={2}>
  <Card title="Connect your AI agent to Zenrows" icon="plug" href="/academy/connect-your-ai-agent">
    Set up the MCP server in Claude, Cursor or VS Code.
  </Card>

  <Card title="Prompts that put Zenrows MCP to work" icon="message" href="/academy/surfaces/mcp-prompts">
    Ready-made prompts for Fetch, Extract, Crawl, Batch and Browser.
  </Card>

  <Card title="Build a browser agent with Zenrows" icon="robot" href="/academy/browser/build-a-browser-agent">
    Let Claude or GPT drive the browser with the Zenrows tools.
  </Card>

  <Card title="Automate scraping from your terminal with the CLI" icon="terminal-2" href="/academy/surfaces/cli-workflows">
    Chain fetch, extract, batch and browser commands in scripts.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.