---
title: "Browser automation"
description: "Browser automation in a cloud browser: log in to portals, run multi-step lookups and download statements with your own Playwright or Puppeteer code."
canonical: https://www.zenrows.com/use-cases/browser-automation
updated: 2026-10-18
---

# Browser automation

Browser automation is software driving a real web browser through a task a person would do by hand: logging in, searching, clicking through steps, downloading files. Zenrows runs that browser in its cloud with Zenrows' stealth; your Playwright or Puppeteer code connects over CDP, and the task returns data or documents to your systems.

## Sample output: one portal retrieval run

```json
{
  "task": "monthly_statement_download",
  "portal": "vendor-portal.example.com",
  "account_ref": "acct_0042",
  "started_at": "2026-10-17T06:00:04Z",
  "finished_at": "2026-10-17T06:02:41Z",
  "steps": [
    { "action": "goto", "target": "/login", "ok": true },
    { "action": "fill", "target": "#username", "ok": true },
    { "action": "click", "target": "button[type=submit]", "ok": true },
    { "action": "goto", "target": "/account/statements", "ok": true },
    { "action": "fetch_file", "target": "statement-2026-09.pdf", "ok": true }
  ],
  "files": [
    { "name": "statement-2026-09.pdf", "bytes": 184320, "period": "2026-09" }
  ],
  "fields": { "amount_due": 4182.5, "currency": "USD", "due_date": "2026-11-05" },
  "status": "completed"
}
```

Illustrative: one run record per task, so a missing statement or failed step shows that morning.

## Browser automation tasks teams run

It pays off on work that lives only inside a website: portals without an API, dashboards without export, four-click lookups.

| Task | What the browser does | Typical targets |
|---|---|---|
| Document retrieval | Logs in, downloads statements, invoices, remittances, CSVs | Vendor, utility, bank and payer portals |
| Status lookups | Reads eligibility, license, permit or case status | Insurer provider portals, state licensing boards, permit and court systems |
| Dashboard checks | Reads balances, metrics, order status | Partner portals and SaaS tools you use |
| Multi-step searches | Searches, filters, pages, reads each result | Government registries, availability calendars, booking systems |
| Data entry | Submits database records into forms | Quote, application and registration forms, see [automated form filling](/use-cases/automated-form-filling) |
| Agent-driven tasks | An AI agent picks the clicks at run time | Any site, via the [MCP Server](/mcp) |

## Why browser automation breaks in production

Laptop scripts fail in week three of a schedule, rarely because of the script.

| What breaks | What it looks like | How Zenrows handles it |
|---|---|---|
| Headless detection at login | The portal flags the sign-in as a bot | Each session runs real Chromium with Zenrows' stealth |
| Datacenter IPs | Cloud-server logins trigger checks or blocks | Zenrows' stealth makes each session look like a regular visitor |
| Bot protection in front of the portal | A Cloudflare or Imperva challenge instead of the sign-in | Zenrows' stealth gets through Cloudflare, Imperva and similar |
| Losing the session mid-task | Logged out between steps | Cookies and auth last the whole session, across pages and tabs |
| Files tied to the session | The file link needs session cookies; plain HTTP gets the login page | Read it in the page with `fetch`, which sends the cookies, and return the bytes |
| Running out of machines | 50 accounts at 6am means 50 local Chromiums | One cloud session per account, in parallel |

## How to automate a browser task with Zenrows

1. **Record the task by hand once**: every page, field, button, and the final value you need.
2. **Connect your script to Zenrows**: point Playwright's `connectOverCDP` or Puppeteer's `connect` at the Zenrows WebSocket URL; nothing else changes.
3. **Keep secrets out of the code**: use env variables or a secrets manager; close the session when done.
4. **Log every step**, like the sample, and alert on runs that stop early.

```python Python
# pip install playwright
import base64
import os
from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(
        "wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY"
    )
    page = browser.new_page()
    page.goto(PORTAL_LOGIN_URL)
    page.fill("#username", os.environ["PORTAL_USER"])
    page.fill("#password", os.environ["PORTAL_PASSWORD"])
    page.click("button[type=submit]")
    page.wait_for_url("**/dashboard")

    page.goto(STATEMENTS_URL)
    pdf_url = page.locator("a.statement-download").first.get_attribute("href")
    pdf_b64 = page.evaluate("""async (url) => {
        const res = await fetch(url, { credentials: "include" });
        const bytes = new Uint8Array(await res.arrayBuffer());
        let binary = "";
        for (const b of bytes) binary += String.fromCharCode(b);
        return btoa(binary);
    }""", pdf_url)
    with open("statement.pdf", "wb") as f:
        f.write(base64.b64decode(pdf_b64))
    browser.close()
```

```javascript Node.js
// A status lookup that takes a search, a filter and a results page
import puppeteer from "puppeteer";

const browser = await puppeteer.connect({
  browserWSEndpoint: "wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY",
});
const page = await browser.newPage();
await page.goto(LOOKUP_URL);
await page.select("#license-type", "contractor");
await page.type("#license-number", "LIC-004417");
await page.click("#search");
await page.waitForSelector(".result-status");
const status = await page.$eval(".result-status", (el) => el.textContent.trim());
console.log({ license: "LIC-004417", status });
await browser.close();
```

```bash CLI
npx -y @zenrows/cli init
# Check what the public status page returns before you script the clicks
zenrows fetch STATUS_PAGE_URL --wait-for ".history-table" --output markdown
zenrows fetch STATUS_PAGE_URL --screenshot --out status.png
# Give your coding agent the browser tools for the interactive steps
zenrows mcp config --client claude-code
```

```text Claude Code (MCP)
# Connect once
claude mcp add zenrows -e ZENROWS_API_KEY=YOUR_ZENROWS_API_KEY -- npx -y @zenrows/mcp

# Then ask:
Use the Zenrows browser to open LOOKUP_URL, choose "contractor" as the license type, search for license number LIC-004417, and tell me the status and expiry date shown in the result. Close the session when done.
```

## Which Zenrows product fits

| If you need to | Use | Why |
|---|---|---|
| Log in, click through and download files | [Browser](/products/browser) | Cloud Chromium driven by Playwright, Puppeteer or any CDP client |
| Check pages and set up from a terminal | [CLI](/cli) | `zenrows fetch` previews a page; `zenrows mcp config` gives your agent browser tools |
| Let an AI agent decide the clicks | [MCP Server](/mcp) | Claude, Cursor and other MCP clients get browser tools on Zenrows |
| Read public pages that need no clicks | [Fetch](/products/fetch) | One request per page, no session to manage |

## What success looks like

| Measure | What good looks like | How to check it |
|---|---|---|
| Run completion | Scheduled runs reach the final step | Share of run records ending `completed` |
| Minutes per task | The same few minutes every run | Session duration, from run records or the Zenrows dashboard |
| Re-login rate | One sign-in per session, no forced re-auth | Runs that hit the login page twice or more |
| Document completeness | Every expected file, every account and period | Files retrieved against the account and period list |
| Manual hours replaced | Manual tasks run on a schedule | Weekly portal hours, before and after |
| Failed step rate | Failures cluster on known steps and drop with fixes | Failed runs by last recorded step |

## Browser automation FAQ

### What is browser automation?

A program driving a browser as a person would: open, type, click, wait, read, download. Used on portals and web apps with no API, mostly via Playwright or Puppeteer.

### When should I use a cloud browser instead of a scraping API?

A scraping API like Fetch for public data at one URL; a browser for sign-ins, click sequences, downloads or state across pages. Many setups mix both: Browser for login and lookup, Fetch for public pages.

### Can I run my existing Playwright or Puppeteer scripts on Zenrows?

Yes. Replace the local browser launch with a connection to wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY , via connectOverCDP in Playwright or connect in Puppeteer. Selectors, waits and page logic stay.

### Does browser automation work with logins and MFA?

Yes: logins work as locally, and cookies persist for every step. For one-time codes, your script reads them from an inbox or authenticator your team controls.

### Can AI agents use Zenrows for browser automation?

Yes. The MCP Server gives Claude, Cursor, Codex and other MCP clients tools to navigate, click, fill and read. The agent picks each step at run time, for tasks too varied for a script. See AI agent browser .

### How do I schedule browser automation tasks?

From your scheduler: cron, CI, Airflow or serverless. The browser runs in the Zenrows cloud, so the trigger needs only your script and network, not Chromium. One session per account, one run record per task, and an alert on early stops, so a missing statement surfaces the same day.

### Is it allowed to automate a portal I have an account on?

Common, but each portal's terms decide, and some restrict automation. Use credentials your organization may use, keep personal and health data within your compliance rules, and ask legal when terms are unclear.

## Related use cases

- [Automated form filling](https://www.zenrows.com/use-cases/automated-form-filling.md): Quote requests, applications and portal data entry submitted from your CSV, with every confirmation captured.
- [AI agent browser](https://www.zenrows.com/use-cases/ai-agent-browser.md): A cloud browser your agent drives over MCP or CDP to log in, click and fill forms.
- [Public records API](https://www.zenrows.com/use-cases/public-records-api.md): Permits, violations, licenses and registry filings from public record portals, returned as JSON on demand.
- [Court records API](https://www.zenrows.com/use-cases/court-records-api.md): Dockets, case status, hearing dates and attorney records from state court and bar portals, kept current.
- [Healthcare provider data](https://www.zenrows.com/use-cases/healthcare-provider-data.md): Clinician and facility records from payer directories and hospital sites, matched on NPI and re-verified on schedule.
- [Website change monitoring](https://www.zenrows.com/use-cases/website-change-monitoring.md): Pricing pages, policies, stock status and IR pages fetched on a schedule and diffed to catch real changes.

Start free: https://app.zenrows.com/register. Docs: https://docs.zenrows.com

## Structured data



<script type="application/ld+json">
{"@context":"https://schema.org","@graph":[{"@type":"WebPage","@id":"https://www.zenrows.com/use-cases/browser-automation#webpage","url":"https://www.zenrows.com/use-cases/browser-automation","name":"Browser automation","description":"Browser automation in a cloud browser: log in to portals, run multi-step lookups and download statements with your own Playwright or Puppeteer code.","isPartOf":{"@id":"https://www.zenrows.com/#website"},"inLanguage":"en","datePublished":"2026-10-18","dateModified":"2026-10-18","about":{"@type":"Thing","name":"browser automation"},"keywords":"browser automation, web automation, browser automation api, cloud browser automation, browser automation tool, ai browser automation, document retrieval, payer portal automation, data entry automation","publisher":{"@type":"Organization","name":"Zenrows","url":"https://www.zenrows.com/"}},{"@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://www.zenrows.com/"},{"@type":"ListItem","position":2,"name":"Use cases","item":"https://www.zenrows.com/use-cases"},{"@type":"ListItem","position":3,"name":"Browser automation","item":"https://www.zenrows.com/use-cases/browser-automation"}]},{"@type":"FAQPage","@id":"https://www.zenrows.com/use-cases/browser-automation#faq","mainEntity":[{"@type":"Question","name":"What is browser automation?","acceptedAnswer":{"@type":"Answer","text":"A program driving a browser as a person would: open, type, click, wait, read, download. Used on portals and web apps with no API, mostly via Playwright or Puppeteer."}},{"@type":"Question","name":"When should I use a cloud browser instead of a scraping API?","acceptedAnswer":{"@type":"Answer","text":"A scraping API like Fetch for public data at one URL; a browser for sign-ins, click sequences, downloads or state across pages. Many setups mix both: Browser for login and lookup, Fetch for public pages."}},{"@type":"Question","name":"Can I run my existing Playwright or Puppeteer scripts on Zenrows?","acceptedAnswer":{"@type":"Answer","text":"Yes. Replace the local browser launch with a connection to wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY , via connectOverCDP in Playwright or connect in Puppeteer. Selectors, waits and page logic stay."}},{"@type":"Question","name":"Does browser automation work with logins and MFA?","acceptedAnswer":{"@type":"Answer","text":"Yes: logins work as locally, and cookies persist for every step. For one-time codes, your script reads them from an inbox or authenticator your team controls."}},{"@type":"Question","name":"Can AI agents use Zenrows for browser automation?","acceptedAnswer":{"@type":"Answer","text":"Yes. The MCP Server gives Claude, Cursor, Codex and other MCP clients tools to navigate, click, fill and read. The agent picks each step at run time, for tasks too varied for a script. See AI agent browser ."}},{"@type":"Question","name":"How do I schedule browser automation tasks?","acceptedAnswer":{"@type":"Answer","text":"From your scheduler: cron, CI, Airflow or serverless. The browser runs in the Zenrows cloud, so the trigger needs only your script and network, not Chromium. One session per account, one run record per task, and an alert on early stops, so a missing statement surfaces the same day."}},{"@type":"Question","name":"Is it allowed to automate a portal I have an account on?","acceptedAnswer":{"@type":"Answer","text":"Common, but each portal's terms decide, and some restrict automation. Use credentials your organization may use, keep personal and health data within your compliance rules, and ask legal when terms are unclear."}}]}]}
</script>
