> ## 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.

# If 元素可见(web)

## 指令说明

**描述：** 检测指定的元素在网页中是否可见。

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-elem-01-panel.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=2c684d17ef7ef5bcf0d81c7089961fd5" alt="If 元素可见(web)指令参数面板" width="660" height="436" data-path="helpcenter/commands/condition/images/if-elem-01-panel.png" />

    | 参数             | 说明                                                                    |
    | -------------- | --------------------------------------------------------------------- |
    | **网页对象**       | 选择一个之前通过【打开网页】或【获取已打开的网页对象】指令创建的网页对象                                  |
    | **选择元素**       | 从元素库中选择一个已捕获的元素或通过「捕获新元素」来捕获新的网页元素作为操作目标                              |
    | **检测元素是否**     | 指定要检测的元素的可见性状态，可以选择"可见"或"不可见"                                         |
    | **检测点击位置未被遮挡** | 是否要附加检测目标元素点击位置未被其他元素遮挡。若勾选，则执行遮挡检测，以确保后期点击操作能够直接作用于目标元素；否则，仅判断元素是否可见 |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-elem-02.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=70cbe15d49b4b23dbc6ab0cddd82fac0" alt="If 元素可见(web) - 流程搭建" width="774" height="241" data-path="helpcenter/commands/condition/images/if-elem-02.png" />

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

使用【打开网页】指令打开百度官网

使用【If 元素可见(web)】判断网页中登录按钮元素是否可见

若可见则执行【点击网页元素】点击登录按钮元素

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-elem-03.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=28fa541fa5cf4c031a199ca21b55c2e2" alt="If 元素可见(web) - 参数设置示例" width="660" height="436" data-path="helpcenter/commands/condition/images/if-elem-03.png" />

RPA 运行前：

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-elem-06-mid.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=91056c09619a3034cf5774c9236133f8" alt="If 元素可见(web) - 运行中" width="1248" height="639" data-path="helpcenter/commands/condition/images/if-elem-06-mid.png" />

RPA 运行后：

<img src="https://mintcdn.com/bazhuayu-rpa-docs/54VOmvcVz9x5vq70/helpcenter/commands/condition/images/if-elem-07-after.png?fit=max&auto=format&n=54VOmvcVz9x5vq70&q=85&s=20d866f4673f80aa0fdc6d3ca8481974" alt="If 元素可见(web) - 运行后" width="1448" height="811" data-path="helpcenter/commands/condition/images/if-elem-07-after.png" />

【If 网页包含】与【If 元素可见(web)】对比

| 场景     | If 网页包含 | If 元素可见(web) |
| ------ | ------- | ------------ |
| 元素可见   | True    | True         |
| 元素隐藏   | True    | False        |
| 相似元素组  | True    | True         |
| 元素被遮挡  | True    | False        |
| 网页文本内容 | True    | False        |

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