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

# 设置Cookie

## 指令说明

**描述：** 在指定页面预设Cookie值，比如登录Cookie等，可通过Cookie工具获取Cookie。

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/web-automation/images/web-cookie-set-01.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=3be3af2791f2bff79122dbbdc26cc338" alt="设置Cookie指令参数面板" width="650" height="433" data-path="helpcenter/commands/web-automation/images/web-cookie-set-01.png" />

    | 参数           | 说明                                               |
    | ------------ | ------------------------------------------------ |
    | **网页对象**     | 选择一个之前通过【打开网页】或【获取已打开的网页对象】指令创建的网页对象             |
    | **设置Cookie** | 手动设置所需操作网页的Cookie信息，不会获取Cookie可使用右侧的"Cookie获取工具" |
  </Tab>

  <Tab title="高级">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/web-automation/images/web-cookie-set-02.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=200310ffd0ec5cafc96d09943f812cbd" alt="设置Cookie指令高级参数面板" width="657" height="320" data-path="helpcenter/commands/web-automation/images/web-cookie-set-02.png" />

    | 参数            | 说明                                 |
    | ------------- | ---------------------------------- |
    | **等待网页加载完成**  | 是否等待网页加载完成，勾选后，会等待网页加载完成后再设置Cookie |
    | **加载超时时间(s)** | 等待网页加载完成的超时时间，单位是秒                 |
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/web-automation/images/web-cookie-set-03.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=4f88abbecd525de66adb1c126869adcb" alt="设置Cookie使用示例 - 流程搭建" width="786" height="179" data-path="helpcenter/commands/web-automation/images/web-cookie-set-03.png" />

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

使用【打开网页】指令打开目标网页

使用【设置Cookie】指令预设Cookie值

后续流程可在已设置Cookie的状态下访问网页

### Cookie获取工具使用教学

<video controls width="100%" src="http://1251101074.vod2.myqcloud.com/8cc84bf5vodgzp1251101074/2531ef695145403697589474300/d061agbXGlsA.mp4">
  您的浏览器不支持视频播放。
</video>

### 效果展示

Cookie设置成功，网页可以携带预设的Cookie信息进行后续操作。

<img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/web-automation/images/web-cookie-set-04.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=8f770e3d425d08839234ca356e71d741" alt="设置Cookie使用示例 - 效果展示" width="1100" height="687" data-path="helpcenter/commands/web-automation/images/web-cookie-set-04.png" />

<img src="https://mintcdn.com/bazhuayu-rpa-docs/v_rTeoLOdoPnGE6I/helpcenter/commands/web-automation/images/web-cookie-set-05.png?fit=max&auto=format&n=v_rTeoLOdoPnGE6I&q=85&s=01e949dd3a558996a1c38619e08f059f" alt="设置Cookie使用示例 - 效果展示 2" width="1100" height="148" data-path="helpcenter/commands/web-automation/images/web-cookie-set-05.png" />

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