Learning resourcesReviewed · Browser Use

Browser Use V4 Network Capture Guide

Browser Use's network capture guide teaches developers to observe live V4 browser traffic, but its example misses earlier traffic and newly opened targets. It uses Python, Playwright and the Chrome DevTools Protocol to save selected request metadata.

Researched 23 Nov 2026

In short.

This Browser Use guide helps developers inspect traffic from live V4 browsers, with coverage limited to pages already open when its example attaches. It explains browser discovery, credential handling and a 30-second Python recorder that saves request metadata as JSON Lines. It does not reconstruct previous traffic or produce a HAR archive. The example was not executed; runtime compatibility, capture completeness and total cost were not assessed.

Researched and written by an AI model and checked by a second AI model. How it works

Coverage comprises the complete supplied page at [https://docs.browser-use.com/cloud/agent/network-capture.md], including its introductory Cloud notices, browser-discovery instructions, Python recorder, privacy warnings and lifecycle limits. Linked documentation, pricing pages, protocol references and dependency documentation are excluded. No commands or code were executed, no browser was observed, and no runtime, billing or completeness claims were independently verified.

The overview

Identity

This is a Browser Use Cloud V4 documentation guide at [https://docs.browser-use.com/cloud/agent/network-capture.md]. It teaches developers to attach an external observer to an existing browser using the Chrome DevTools Protocol, or CDP, and includes a Python example for recording network metadata.

Assessment

The documented fields can help investigate contacted hosts, HTTP status codes, failed loads, content types and transferred bytes during an observation window. The main constraint is incomplete visibility: startup traffic and several target types are excluded. An empty file cannot establish that the agent made no requests.

Users

The guide fits developers building or debugging Browser Use Cloud V4 integrations. Beginners need familiarity with environment variables, API authentication and running Python scripts. Experienced developers get a starting point for page-level observation, but comprehensive browser coverage requires additional target handling.

Capabilities

The example records request method, HTTP or HTTPS origin, resource type, response status, MIME type, encoded transfer length and loading errors. Each row includes an event label, page number and request ID.

It writes and flushes one JSON object per line to network.jsonl. File creation requests owner-only permissions and refuses to overwrite an existing file. The example does not navigate, intercept requests, change the cache or stop the browser.

Using it

Requirements

You need a live V4 browser, an API key with browser read access in the same project, Python and the Playwright package. The supplied browser-discovery shell example also uses curl and jq. No local browser download is needed because Playwright connects to the existing browser.

The logger expects BROWSER_CDP_URL in its environment. A stopped browser has no live CDP URL. Minimum Python and Playwright versions are not specified.

Mechanism

The browser.ready and browser.reattached run events expose data.browser_session_id. This identifies a browser, distinct from the agent session and run IDs. The guide also documents listing browsers through GET /api/v4/browsers?agentSessionId=SESSION_ID.

The Python code connects over CDP, takes the first browser context and creates a CDP session for each page present at startup. It registers four Network event handlers and enables network observation. Records are correlated by page number and request ID; event order matters because redirects can reuse a request ID.

Setup

The documented setup installs Playwright with pip install playwright. Retrieve the active browser's cdpUrl through GET /api/v4/browsers/BROWSER_SESSION_ID using X-Browser-Use-API-Key authentication, then place that URL in BROWSER_CDP_URL. For a standalone browser, its creation response can supply the URL.

Save the provided script as capture_network.py and start it before the activity of interest. Its default observation window is 30 seconds. Treat the CDP URL as a credential: a person who can connect can control the browser and read its session.

Example

A practical application is investigating a page load during an agent task. Start the observer on the current live browser before triggering that activity, then inspect the resulting request, response and completion or failure rows together. Response status and transfer length can help narrow the investigation, while the origin identifies the contacted host without retaining its URL path or query. This is an illustrative use; no actual capture output was produced.

Assessment & evidence

Limitations

Observation begins only after Network.enable on each attached page. Earlier requests are not reconstructed, and attaching after browser.ready can miss startup traffic. The example covers existing pages only; popups, new tabs, workers, service workers and some cross-process frames need separate handling.

A replacement browser requires reattachment. The JSONL output is not HAR and excludes URL paths, queries, credentials, headers, cookies and request or response bodies. Non-HTTP or malformed URLs have a null origin. Origins can still reveal sensitive information.

Reasoning

The field choices reduce retained request detail while preserving host, status and size information. Consequently, this approach can support host-level troubleshooting, but the saved data cannot identify a particular URL path, inspect authentication headers or explain response contents. The tradeoff suits limited live diagnostics; broader claims about an agent's complete network activity require additional evidence.

Alternatives

V4 run events provide agent-activity information and can complement the observer, but they do not supply the browser's HTTP request log. A HAR exporter requires additional request, redirect, timing and body handling. Response bodies require a separate optional Network.getResponseBody call; availability is not guaranteed, and bodies may contain secrets or customer data. Other products were not assessed.

Evidence

The evidence is the complete supplied documentation page, including its browser-discovery commands, Python example and stated coverage boundaries. It supports describing the intended procedure and implementation, but provides no executed trace, benchmark or independent compatibility result. Nothing was executed; actual output, performance and credential protection in operation remain unverified.

Access & freshness

Costs

The page describes Cloud billing as pay as you go and gives a general example of $3 plus traffic for 50 browsers running for one hour. That example does not establish the price of this 30-second observation or an individual account's total charges.

Detaching the observer does not stop browser billing. The surrounding notices say idle V4 agent browser time is billable and that the default browser lifetime after the last run activity is about 120 seconds. The complete cost of browser, network and any associated agent usage remains unknown.

Rights

The supplied page does not state a license for its prose or Python example. Permission to redistribute or commercially reuse those materials is unknown. Dependency licenses and the Cloud service's legal terms are not established by this page.

Freshness

The supplied snapshot was captured on 23 November 2026 at 03:15:31 UTC. It explicitly targets Cloud API V4. The page gives no page-specific publication or last-update date and no dependency compatibility matrix. Changes after capture and compatibility with particular installed package versions are unknown.

Actions

Before using the example, identify the correct active browser and project, keep the CDP URL private and start observation before the required activity. Choose a bounded capture period and retention period, and review recorded origins before sharing the file.

Add target handling if the task opens new pages or uses workers, and reattach when the agent receives a replacement browser. Leave agent-owned browsers under the agent's lifecycle; stop a standalone browser you created through the browser API when finished.

Evidence for this report

selected-page.txtselected · checked 2026-11-23