> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/help-center/cn/ru-men/start-using-agent-browser.md).

# 开始使用 Agent Browser

购买和使用 Oxylabs Agent Browser 以自动化 AI 代理和网页抓取浏览操作的入门指南。

### 创建一个 Agent Browser 用户

1. 创建一个 [仪表板](https://dashboard.oxylabs.io/) 账户并前往 **定价**.
2. 选择适合你需求的定价方案。每个新账户还会获得一笔欢迎额度，可立即使用。请参阅 [定价和账单的工作方式了解详情](/help-center/cn/zui-chang-jian-de-wen-ti/ji-fei-he-jia-ge-ru-he-yun-zuo.md).
3. 在仪表板中创建一个 Agent Browser 实例。在确认之前，必须先为该实例命名。
4. 你的用户名和密码会自动生成，并可随时在实例设置中查看。

### 发起你的第一个请求

你可以使用 Playwright、Puppeteer，或任何支持 Chrome DevTools Protocol (CDP) 的工具连接到 Agent Browser。此外，你还可以通过 [模型上下文协议](broken://spaces/BQ7Zf9paoN3FTeGcyfY1/pages/qKJOfgGohJ93ZxpTrwjL) (MCP) 直接与 AI 应用集成，从而实现浏览工作流程的完全自动化。

让我们使用 Playwright 尝试建立一个基础连接。

#### Python 中的 Playwright 示例

通过终端安装 Playwright 库：

```
pip install playwright
```

使用你的 Agent Browser 凭据并运行代码：

```python
from playwright.sync_api import sync_playwright

username = "your-username"
password = "your-password"
endpoint = "hb.oxylabs.io"
browser_url = f"wss://{username}:{password}@{endpoint}"

with sync_playwright() as p:
    browser = p.chromium.connect_over_cdp(browser_url)
    page = browser.new_page()
    page.goto('https://oxylabs.io/')
    print(page.title())
    browser.close()
```

#### Playwright 的 JavaScript 示例

通过终端安装 Playwright 库：

```
npm init -y
npm install playwright
```

输入你的 Agent Browser 凭据并运行代码：

```javascript
const { chromium } = require('playwright');

(async () => {
    const username = 'your-username';
    const password = 'your-password';
    const endpoint = 'hb.oxylabs.io';
    const browserUrl = `wss://${username}:${password}@${endpoint}`;

    const browser = await chromium.connectOverCDP(browserUrl);
    const page = await browser.newPage();
    await page.goto('https://oxylabs.io/');
    console.log(await page.title());
    await browser.close();
})();
```

有关使用 Agent Browser 的更多信息和示例，请访问我们的 [**详细文档**](/products/agent-browser.md) 或联系我们的支持团队： [**support@oxylabs.io**](mailto:support@oxylabs.io).

### 其他免费功能

* 内置代理服务器，可将请求路由到特定地理位置。
* 国家、城市和州级 [地理定位](/products/agent-browser/geolocation-and-proxy-selection.md) 用于精确定位会话运行所在的具体位置。
* [会话检查和录制](/products/agent-browser/session-inspection-and-recording.md) 用于对浏览自动化会话进行可视化调试。
* 指定 [设备类型](/products/agent-browser/device-type.md) 用于处理响应式布局、移动端内容以及验证码或 UI 元素。
* [验证码处理](/products/agent-browser/captcha-handling.md) 以及对动态、加载后验证码的动态手动触发。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/help-center/cn/ru-men/start-using-agent-browser.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
