> 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gpmautomate.com/huong-dan-cac-action/navigation/get-url.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
