browser

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Bright Data - Browser

Bright Data - Browser

The user already wrote the automation. This skill changes the launch line so it runs on Bright Data's cloud browser instead of the local one, wires in the credentials that line needs, and runs it once to prove it connects. Their automation logic does not move.
用户已经编写了自动化代码。本 skill 的作用是修改启动配置,使其改为在 Bright Data 的云端浏览器而非本地浏览器上运行,配置该启动方式所需的凭据,并运行一次以证明连接成功。自动化逻辑本身无需改动。

The one question

唯一的问题

Who does the clicking - your code, your AI model, or us?
Who clicksWhere it goes
Their code: Playwright, Puppeteer, or SeleniumStay here. Point it at our cloud browser, nothing to rewrite.
Their computer-use model, the AI that clicks by itselfStay here. Same swap, same endpoint.
The agent itself, step by step from a terminalStay here and drive
bdata browser
:
open
,
snapshot
,
click <ref>
,
type <ref>
,
close
, one command per action, no code to hold. Every subcommand is in
bdata browser --help
, and the
brightdata-cli
skill's
references/commands.md
has the session options.
Us
scrape
. Scraper Studio does the clicking, and the user gets fields back instead of a driver to maintain.
Ask it when the request names a framework, a technique, or an agent but leaves who drives the browser unstated. Ask it once, then act. A user holding working Playwright code and a blocked local browser never needs to hear about Scraper Studio.
由谁执行点击——你的代码、你的 AI 模型,还是我们?
谁执行点击如何处理
用户的代码:Playwright、Puppeteer 或 Selenium继续使用本 skill。将其指向我们的云端浏览器,无需重写。
用户的 computer-use model,即自主点击的 AI继续使用本 skill。进行同样的替换,使用同一个 endpoint。
Agent 本身,从终端逐步操作继续使用本 skill 并驱动
bdata browser
:
open
、
snapshot
、
click <ref>
、
type <ref>
、
close
,每个操作对应一条命令,无需维护代码。所有子命令均可在
bdata browser --help
中查看,
brightdata-cli
skill 的
references/commands.md
中提供了会话选项。
我们
scrape
。Scraper Studio 负责点击,用户获得字段结果,而无需维护 driver。
当请求提到某个 framework、technique 或 agent,却未说明由谁驱动浏览器时,先询问一次,然后执行。对于持有可正常工作的 Playwright 代码且本地浏览器被封锁的用户,绝不需要提到 Scraper Studio。

What the swap is

这次替换

The local launch call becomes a remote connect call against a websocket:
wss://brd-customer-<CUSTOMER_ID>-zone-<ZONE>:<PASSWORD>@brd.superproxy.io:9222
Selenium is the one exception. It speaks WebDriver, not CDP, so it uses
https://
on port
9515
with the same credentials. Selectors, waits, navigation, screenshots and page logic all stay exactly as written.
The agent fills the three pieces itself, with free API reads and the key the user already has (
BRIGHTDATA_API_KEY
, else the CLI's stored login), never with placeholders left for the user. No key anywhere means the user is not set up: hand off to
agent-onboarding
, never ask for a key in chat. references/connect.md has the lookup and the two ways to wire it.
原本的本地启动调用将改为通过 websocket 发起远程连接调用:
wss://brd-customer-<CUSTOMER_ID>-zone-<ZONE>:<PASSWORD>@brd.superproxy.io:9222
Selenium 是唯一的例外。它使用 WebDriver 而非 CDP,因此使用
https://
和端口
9515
,并使用相同凭据。选择器、等待、导航、截图和页面逻辑都保持原样。
Agent 会自行填写这三部分,使用免费的 API 读取调用以及用户已有的 key(
BRIGHTDATA_API_KEY
,否则使用 CLI 中保存的登录凭据),绝不留下需要用户填写的占位符。如果完全没有 key,说明用户尚未完成设置:转交
agent-onboarding
,绝不要在对话中索要 key。references/connect.md 中包含查找方式以及接入的两种方式。

The zone

Zone(区域)

Find the Browser API zone by type, not by name, before writing the string:
bdata zones --json
Take the
name
of the entry whose
"type"
is
"browser_api"
, and use it wherever the connect string says
<ZONE>
. It is
cli_browser
after
bdata login
,
agent_browser_api
on an account made by agent registration,
mcp_browser
when the MCP server set the account up, and any name at all when a person created it by hand: read the type, then use whatever name it carries. This is one free read and it starts no session. If
bdata
is not recognized, the CLI is not installed or npm's global directory is not on PATH; both fixes live in the
agent-onboarding
skill's Install section.
No entry of that type at all is not a connect string to fix, but it is not an account problem yet either. The remedy, after the user agrees (it changes their account), is one free call,
POST https://api.brightdata.com/zone
with body
{"zone":{"name":"cli_browser","type":"browser_api"},"plan":{"type":"browser_api"}}
.
bdata browser open
creates one on demand too, but that starts a billable session, and it uses the name
cli_browser
unless given
--zone <name>
or
BRIGHTDATA_BROWSER_ZONE
, so on an account whose browser zone has another name, pass that name or it makes a second zone (with an agent-registration key it cannot create one and fails instead; pass
--zone agent_browser_api
). Do not reach for
bdata login
on a machine that is already logged in: it replaces the stored key. Escalate to
agent-onboarding
when the creation is refused with
kyc_required
or
business_account_required
, or on a permissions refusal (a key from agent registration, or a user without the Admin or Ops role, cannot create zones): the person then makes the zone in the Control Panel.
在编写连接字符串之前,按类型而非名称查找 Browser API zone:
bdata zones --json
取
"type"
为
"browser_api"
的条目的
name
,并在连接字符串中
<ZONE>
所指的位置使用它。执行
bdata login
后,它是
cli_browser
;对于通过 agent registration 创建的账户,它是
agent_browser_api
;当 MCP server 设置账户时,它是
mcp_browser
;如果用户手动创建,则名称任意:读取类型,然后使用它实际携带的名称。这只需一次免费读取,不会启动会话。如果系统无法识别
bdata
,说明 CLI 未安装,或 npm 的全局目录不在 PATH 中;两种修复方法都在
agent-onboarding
skill 的 Install 部分。
如果完全没有该类型的条目,这并不是需要修复的连接字符串问题,但也不能直接判定为账户问题。补救方法是在用户同意后(这会更改其账户),发起一次免费调用:
POST https://api.brightdata.com/zone
,请求体为
{"zone":{"name":"cli_browser","type":"browser_api"},"plan":{"type":"browser_api"}}
。
bdata browser open
也会按需创建一个,但会启动计费会话,并且除非指定
--zone <name>
或
BRIGHTDATA_BROWSER_ZONE
,否则使用名称
cli_browser
;因此,如果账户的 browser zone 名称不同,应传入该名称,否则会创建第二个 zone(使用 agent registration key 时无法创建并直接失败;此时传入
--zone agent_browser_api
)。不要在已经登录的机器上执行
bdata login
:它会替换已保存的 key。当创建请求因
kyc_required
或
business_account_required
被拒绝,或因权限被拒(来自 agent registration 的 key,或不具备 Admin 或 Ops 角色的用户,都无法创建 zone)时,转交
agent-onboarding
:此时需要由用户在 Control Panel 中创建 zone。

The boundaries

边界

Building the scraper belongs to
scrape
, and so does any ask where the user wants data and does not care what drives the browser. One page as markdown, HTML, or a screenshot belongs to
fetch
. Anything starting from a search query belongs to
search
. This skill is for a driver that already exists.
构建 scraper 属于
scrape
,用户只想要数据、不关心由什么驱动浏览器的请求也属于
scrape
。将单个页面转换为 markdown、HTML 或截图属于
fetch
。从搜索查询开始的任务属于
search
。本 skill 仅适用于已经存在的 driver。

Logging into sites

登录网站

Typing passwords through Browser API is blocked by default. It needs KYC plus a compliance exception. Never promise a login flow before that is approved, and never retry into the block. The deep detail lives one skill over: open
agent-onboarding
and read the
references/auth.md
file inside it, which lists what needs KYC, what does not, and the approval path.
默认情况下,禁止通过 Browser API 输入密码。此功能需要完成 KYC 并获得合规例外。在获得批准前,绝不要承诺可以执行登录流程,也不要在遇到阻止后反复重试。详细说明位于另一个 skill 中:打开
agent-onboarding
并阅读其中的
references/auth.md
文件,该文件列出了哪些操作需要 KYC、哪些不需要,以及审批流程。

Read next

接下来阅读

  • Read references/connect.md before writing the connect line - the exact string, where the key and each of the three pieces come from, the two designs (endpoint in a secret, or looked up at run time) and when to pick which, and the Playwright edit end to end.
  • Read references/errors.md the moment a connect attempt fails - the 407
    client_100xx
    codes and what each means, the Browser API auth codes, and the retry rule.
  • 在编写连接行之前,阅读 references/connect.md——精确的字符串、key 与三个组成部分的来源、两种设计(将 endpoint 放入 secret,或在运行时查找)以及何时选择哪一种,还有 Playwright 端到端的修改方式。
  • 一旦连接尝试失败,立即阅读 references/errors.md——407
    client_100xx
    错误码及其含义、Browser API 认证错误码和重试规则。

Red flags - stop if you catch yourself doing one of these

危险信号——发现以下情况时停止

  • Offering Scraper Studio to a user who already has working driver code
  • Rewriting their automation instead of changing the endpoint line
  • Pointing Selenium at port 9222, or Playwright at 9515
  • Printing, logging, or committing the assembled endpoint, which carries the password, or printing a connect error without redacting it
  • Running
    bdata zones info <zone>
    in a terminal: it prints the zone password
  • Leaving the user a variable to fill, or asking for a key, when the agent can read the stored key itself
  • Retrying a 407 without reading which code came with it
  • Sending the user to KYC before an error actually refused the connect
  • Hardcoding or guessing a zone name instead of finding the
    browser_api
    zone by type
  • Creating a zone without asking the user first
  • 向已经拥有可用 driver 代码的用户提供 Scraper Studio
  • 重写其自动化代码,而不是只修改 endpoint 行
  • 将 Selenium 指向端口 9222,或将 Playwright 指向 9515
  • 打印、记录或提交包含密码的完整 endpoint,或在输出连接错误时未做脱敏
  • 在终端运行
    bdata zones info <zone>
    :它会输出 zone 密码
  • 在 Agent 能够自行读取已保存的 key 时,仍给用户留下需要填写的变量,或索要 key
  • 未查看随 407 一起返回的错误码就重试
  • 在连接错误实际以拒绝形式返回之前,就让用户去完成 KYC
  • 硬编码或猜测 zone 名称,而不是按类型查找
    browser_api
    zone
  • 未经用户询问就创建 zone