# 网页爬虫API Playground

[**网页爬虫API Playground**](https://dashboard.oxylabs.io/?route=/api-playground) 是 Oxylabs 仪表板中的一款交互式工具。它允许你在简化环境中构建和测试网页爬虫API 请求。

借助网页爬虫API Playground，你可以尝试不同的目标，调整请求参数，预览结果，并导出可直接使用的代码片段。它专为初学者和高级用户、快速原型开发以及验证请求设置而设计。

它还集成了 [**OxyCopilot**](https://developers.oxylabs.io/scraping-solutions/oxycopilot)，这是一个由 AI 驱动的助手，可帮助生成解析规则、创建解析器预设、构建爬虫，并根据自然语言提示生成浏览器指令。

## 主要功能

网页爬虫API Playground 是用于试验网页爬虫API 请求的主要环境。其主要功能包括：

* **交互式请求构建器** – 选择一个来源（Universal、Amazon、Google、YouTube 等），输入一个 URL 或查询，并直接从仪表板运行请求。
* **参数自定义** – 调整 JavaScript 渲染、地理位置、语言区域、解析、用户代理类型等选项。
* **结果预览** – 以原始 HTML 或解析后的 JSON 查看响应，以确认请求输出。
* **导出选项** – 复制生成的代码片段（cURL、Python 等）或请求负载以便进一步使用。
* [**OxyCopilot**](https://developers.oxylabs.io/scraping-solutions/oxycopilot) **集成** – 使用内置助手通过自然语言自动创建爬虫请求负载、解析逻辑、可复用的解析器预设或浏览器指令。

{% hint style="info" %}
在抓取时，网页爬虫API Playground 适用于 **测试和探索**。对于大规模或自动化工作流，请使用标准的网页爬虫API 集成方法（[Realtime](/products/cn/web-scraper-api/integration-methods/realtime.md), [Push-Pull](/products/cn/web-scraper-api/integration-methods/push-pull.md)，或 [Proxy Endpoint](/products/cn/web-scraper-api/integration-methods/proxy-endpoint.md)).
{% endhint %}

## 如何使用

使用网页爬虫API Playground 非常简单。请按照以下步骤操作：

{% stepper %}
{% step %}

### 访问网页爬虫API Playground

登录到 [Oxylabs 控制台](https://dashboard.oxylabs.io/) 并打开网页爬虫API Playground。

<figure><img src="/files/8f0f21795d9e10715244525a8f6645e7258cf3bb" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 选择来源

选择一个专用来源——特定网站（例如 Google、Amazon、YouTube 等更多网站）以及爬虫来源（例如 URL、 `amazon_product`, `google_search`）或“--Any other website--”，用于下拉菜单中未列出的网站。

<figure><img src="/files/551c4621fcb19deeb6f228c31ea2c51df0227518" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 输入查询或 URL

提供你想要抓取的搜索查询或页面 URL。

<figure><img src="/files/5462da057bc90fcec6611f4eec66dfa5c42e725f" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 添加附加参数（可选）

根据你的使用场景调整渲染、解析、本地化或其他选项。

<figure><img src="/files/0d0168151ea20d2f45165db9c4f6c6948e3ac696" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 运行请求

提交你的请求，并立即预览返回的数据。

<figure><img src="/files/7981fa5fbdf41847772fdefdc95f9d4964f9b6ee" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 导出

如果你对结果满意，可以复制生成的代码片段或请求负载到你偏好的编程语言中，并在脚本或应用程序中使用。你也可以使用右上角下拉菜单导出 JSON 或 HTML 结果。

<figure><img src="/files/2d29e144b3a30b5ac665f3640b5cc019dbbfc5cc" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

## 访问与试用

拥有网页爬虫API 访问权限的所有 Oxylabs 仪表板用户都可使用网页爬虫API Playground。

* **试用用户** 可以使用 [免费试用](https://oxylabs.io/products/scraper-api/web/pricing).
* **付费用户** 可以将网页爬虫API Playground 与其常规 API 集成一起使用，作为测试和原型开发环境。


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/products/cn/web-scraper-api/web-scraper-api-playground.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
