> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/keyboard/select-dropdown.md).

# Select dropdown

Select dropdown 是一个操作指令，用于命令浏览器自动在下拉菜单列表中选择一个特定的值。

🎥 查看更多指导视频：[点击这里](https://youtu.be/cCTEtuMtz-s)。

> ⚠️ 重要提示：此操作仅对标准 HTML 结构为 `<select>` 的标签有效（例如：选择省/市、传统出生年份等菜单）。
>
> 对于由 `<div>` 或 `<span>` 标签自定义构建的新一代下拉框（如某些现代社交网络的界面），此操作将不起作用。在这种情况下，您需要通过以下方式处理：使用 Mouse click 命令点击下拉框使列表展开 ➔ 再使用第二个 Mouse click 命令，根据该行的 XPath 点击需要选择的值。

#### 配置参数：

* XPath：直接指向网页上 `<select>` 标签的识别代码路径（XPath）（例如：`(//select)[1]`。
* Select text：根据屏幕上公开显示的文字内容填写（例如：`<option value="VN">Việt Nam</option>` ➔ 填写值为 `Việt Nam`）。

#### 实际示例：注册账户时自动选择国家

当您的脚本运行到注册账户信息的步骤，并遇到一个选择国家的菜单框时。

* 配置方法：
  * XPath：`(//select)[1]`
  * Select text：填写 Australia
* 结果：系统将立即激活选择框，并准确、安全地将屏幕上显示的值切换为"Australia"。

<figure><img src="https://1806980278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiDNNiVZHPKSIcyshmOTB%2Fuploads%2Fgit-blob-18e1d1c05decea4bf492f72b06bd272d52c6ae04%2Fkb-03.png?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1806980278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiDNNiVZHPKSIcyshmOTB%2Fuploads%2Fgit-blob-b8e0df5f4a2aa55a563a852708b82877ca4a1cda%2Fkb-03b.png?alt=media" alt=""><figcaption></figcaption></figure>


---

# 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://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/keyboard/select-dropdown.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.
