> 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/navigation/get-url.md).

# Get URL

Get URL 是用于提取当前浏览器打开的网页完整地址(URL),并保存到一个变量中的操作。

🎥 观看更多教程视频:[点击这里](https://youtu.be/a9qNt96X1SM)。

#### 配置参数:

* Output variable:您自行设置的变量名称,用于保存成功提取后的网站地址字符串。

#### 实际案例:检查登录成功后的跳转状态

当您制作自动登录(Login)某个平台(例如 Pinterest 或 Facebook)的脚本时。在填写信息并点击登录按钮后,您想要检查账号是否成功进入主页,还是被跳转到错误提示页面/要求身份验证(Checkpoint)页面:

* 配置方法:
  * 点击登录按钮后等待几秒,调用 Get URL 操作。
  * Output variable:将变量命名为 `currentLink`。
  * 结合在后面插入 If 条件块,以检查 `$currentLink` 变量的数据:
    * *情况 1*:如果 `$currentLink` 变量中包含 `checkpoint` 或 `login_error` 字词 ➔ 脚本识别为账号出错并停止流程。
    * *情况 2*:如果 `$currentLink` 变量中包含 `home` 字词或数据已跳转到个人主页 ➔ 脚本识别为登录成功并继续运行养号相关任务。


---

# 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://docs.gpmautomate.com/automate-zh/action-shi-yong-zhi-nan/navigation/get-url.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.
