> 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/huong-dan-cac-action/navigation/get-url.md).

# Get URL

Get URL là hành động dùng để trích xuất toàn bộ đường dẫn địa chỉ (URL) của trang web hiện tại đang mở trên trình duyệt và lưu vào một biến số.

🎥 Xem thêm video hướng dẫn: [Tại đây](https://youtu.be/a9qNt96X1SM).

#### Tham số cấu hình:

* Output variable: Tên biến số do bạn tự đặt để lưu lại chuỗi địa chỉ trang web sau khi bóc tách thành công.

#### Ví dụ thực tế: Kiểm tra trạng thái chuyển hướng sau khi đăng nhập thành công

Khi bạn làm kịch bản tự động đăng nhập (Login) vào một nền tảng nào đó (ví dụ như Pinterest hoặc Facebook). Sau khi điền thông tin và bấm nút đăng nhập, bạn muốn kiểm tra xem tài khoản đã vào được trang chủ thành công hay bị chuyển hướng sang trang báo lỗi/bắt xác minh danh tính (Checkpoint):

* Cách cấu hình:
  * Đợi một vài giây sau khi bấm nút đăng nhập, gọi hành động Get URL.
  * Output variable: Đặt tên biến là `currentLink`.
  * Kết hợp chèn khối lệnh điều kiện If phía sau để kiểm tra dữ liệu của biến `$currentLink`:
    * *Trường hợp 1*: Nếu biến `$currentLink` chứa cụm từ `checkpoint` hoặc `login_error` ➔ Kịch bản nhận diện tài khoản lỗi và xử lý dừng luồng.
    * *Trường hợp 2*: Nếu biến `$currentLink` chứa cụm từ `home` hoặc dữ liệu chuyển sang trang cá nhân ➔ Kịch bản nhận diện đăng nhập thành công và chạy tiếp các tác vụ nuôi tài khoản.


---

# 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/huong-dan-cac-action/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.
