> 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/products/cn/headless-browser/device-type.md).

# 设备类型

学习如何设置设备类型，以更准确地抓取响应式布局和特定设备内容。

与其在本地库配置中手动设置视口、触摸支持和 User-Agent 标头（这可能会导致指纹不匹配并触发连接超时），无头浏览器允许你通过添加 `p_device` 查询参数到你的连接字符串中：

```bash
wss://username:password@hb.oxylabs.io?p_device=mobile
```

### 支持的设备配置文件

你可以配置 `p_device` 参数，使用以下三个受支持的设备配置文件：

<table><thead><tr><th width="123">参数值</th><th width="620">说明</th></tr></thead><tbody><tr><td><code>桌面端</code><br><em>（默认）</em></td><td>全尺寸视口、桌面平台标头、标准鼠标/键盘输入模式，以及桌面端 User-Agent 字符串。</td></tr><tr><td><code>移动端</code></td><td>紧凑型移动视口、已启用触摸事件 API、移动操作系统平台标头，以及移动端 User-Agent。</td></tr></tbody></table>


---

# 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 dynamically by asking a question.

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

```
GET https://developers.oxylabs.io/products/cn/headless-browser/device-type.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
