> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取下拉框选项(web)

## 指令说明

**描述：** 获取网页中下拉框的选项，仅支持`<select>`标签下拉框

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/_udziDO1jBiOpIxe/helpcenter/commands/web-automation/images/web-select-opt-01.png?fit=max&auto=format&n=_udziDO1jBiOpIxe&q=85&s=4abf3d7a8aec7f2c0057f0cb89efa98d" alt="获取下拉框选项(web)指令参数面板" width="649" height="465" data-path="helpcenter/commands/web-automation/images/web-select-opt-01.png" />

    | 参数       | 说明                                                                     |
    | -------- | ---------------------------------------------------------------------- |
    | **网页对象** | 选择一个之前通过【打开网页】或【获取已打开的网页对象】指令创建的网页对象                                   |
    | **选择元素** | 从元素库中选择一个已捕获的元素或通过「捕获新元素」来捕获新的网页元素作为操作目标                               |
    | **获取内容** | 选择要获取当前选中项或全部下拉项：<br />当前选中项：只返回当前选项框已选择的选项值<br />全部下拉项：返回当前选项框的所有待选项值 |
  </Tab>

  <Tab title="高级">
    | 参数            | 说明                  |
    | ------------- | ------------------- |
    | **等待元素存在（s）** | 等待目标元素存在的最大超时时间，单位秒 |
  </Tab>
</Tabs>

## 使用示例

案例中使用的网站：[https://www.ggzy.gov.cn/deal/dealList.html](https://www.ggzy.gov.cn/deal/dealList.html)

<img src="https://mintcdn.com/bazhuayu-rpa-docs/_udziDO1jBiOpIxe/helpcenter/commands/web-automation/images/web-select-opt-02.png?fit=max&auto=format&n=_udziDO1jBiOpIxe&q=85&s=469ca2ac10fae663c19af879bf8435eb" alt="获取下拉框选项(web)使用示例" width="1449" height="650" data-path="helpcenter/commands/web-automation/images/web-select-opt-02.png" />

**该流程执行逻辑：**

使用【获取下拉框选项(web)】指令获取「省份」的所有选项值，返回所有待选项值的列表

<img src="https://mintcdn.com/bazhuayu-rpa-docs/_udziDO1jBiOpIxe/helpcenter/commands/web-automation/images/web-select-opt-03.png?fit=max&auto=format&n=_udziDO1jBiOpIxe&q=85&s=cdfcdb3ed05ae288ebec1d183d253848" alt="获取下拉框选项(web)使用示例 2" width="1001" height="206" data-path="helpcenter/commands/web-automation/images/web-select-opt-03.png" />

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/_udziDO1jBiOpIxe/helpcenter/commands/web-automation/images/web-select-opt-04.png?fit=max&auto=format&n=_udziDO1jBiOpIxe&q=85&s=3e9fdd06f7f7a595dbad5b5dfda5d6cf" alt="获取下拉框选项(web)效果展示" width="1343" height="257" data-path="helpcenter/commands/web-automation/images/web-select-opt-04.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/_udziDO1jBiOpIxe/helpcenter/commands/web-automation/images/web-select-opt-05.png?fit=max&auto=format&n=_udziDO1jBiOpIxe&q=85&s=0c3e080ec5f2176f8710b126671f2837" alt="获取下拉框选项(web)效果展示 2" width="1279" height="895" data-path="helpcenter/commands/web-automation/images/web-select-opt-05.png" />

### 使用小 Tips

* 若想获取当前选项已选择的值，在指令【获取下拉框选项(web)】中「获取内容」选择"当前选中项"即可
* 此指令仅适用于 **select** 标签的网页标准式下拉框元素，可以通过观察网页对象的源码 HTML 页面结构来判断是否是"标准式下拉框"；在浏览器网页页面上，鼠标右击"检查"或者按下"F12"按键打开进入到"开发者调试的模式"，观察"下拉框"对应的页面源码是否有 **"select"标签**，"select"标签下的选项是 **"option"标签**，具备这两种标签的才是"标准式下拉框"。如下图

<img src="https://mintcdn.com/bazhuayu-rpa-docs/_udziDO1jBiOpIxe/helpcenter/commands/web-automation/images/web-select-opt-06.png?fit=max&auto=format&n=_udziDO1jBiOpIxe&q=85&s=1725beeca14074022deb06ff37750132" alt="获取下拉框选项(web) - select示例" width="1547" height="579" data-path="helpcenter/commands/web-automation/images/web-select-opt-06.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
