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.
Updated
{
"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"
}
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 |
| Agent-driven tasks | An AI agent picks the clicks at run time | Any site, via the MCP Server |
Why browser automation breaks in production
Laptop scripts fail in week three of a schedule, rarely because of the script.
The portal flags the sign-in as a bot
Each session runs real Chromium with Zenrows' stealth
Cloud-server logins trigger checks or blocks
Zenrows' stealth makes each session look like a regular visitor
A Cloudflare or Imperva challenge instead of the sign-in
Zenrows' stealth gets through Cloudflare, Imperva and similar
Logged out between steps
Cookies and auth last the whole session, across pages and tabs
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
50 accounts at 6am means 50 local Chromiums
One cloud session per account, in parallel
How to automate a browser task with Zenrows
- Record the task by hand once: every page, field, button, and the final value you need.
- Connect your script to Zenrows: point Playwright's
connectOverCDPor Puppeteer'sconnectat the Zenrows WebSocket URL; nothing else changes. - Keep secrets out of the code: use env variables or a secrets manager; close the session when done.
- Log every step, like the sample, and alert on runs that stop early.
# 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()// 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();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# 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
- Log in, click through and download files BrowserCloud Chromium driven by Playwright, Puppeteer or any CDP client
- Check pages and set up from a terminal CLIzenrows fetch previews a page; zenrows mcp config gives your agent browser tools
- Let an AI agent decide the clicks MCP ServerClaude, Cursor and other MCP clients get browser tools on Zenrows
- Read public pages that need no clicks FetchOne 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
-
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.
-
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.
-
Yes. Replace the local browser launch with a connection to
wss://browser.zenrows.com?apikey=YOUR_ZENROWS_API_KEY, viaconnectOverCDPin Playwright orconnectin Puppeteer. Selectors, waits and page logic stay. -
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.
-
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.
-
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.
-
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.