> For the complete documentation index, see [llms.txt](https://docs.hidemium.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hidemium.io/zi-dong-hua-yong-hu-shou-ce/shu-ju-data/huo-qu-shu-xing-zhi-get-attribute-value.md).

# 获取属性值 (Get attribute value)

此按钮允许您从此处放置的元素中获取属性值，您需要填写要获取值的属性名称，并为该值设置导出变量。

<figure><img src="/files/bMWtYieENYnykYrEBJ2I" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="258">参数</th><th>说明</th></tr></thead><tbody><tr><td>Attribute name</td><td>要获取其值的属性的名称。例如：title、alt、color、class、...</td></tr><tr><td>Select element</td><td>输入 CSS 选择器，例如 #email、#global-enhancements-search-query</td></tr><tr><td>Element order</td><td>根据元素在页面上出现的顺序选择元素</td></tr><tr><td>Output Variable</td><td>将提取的值保存到变量中</td></tr></tbody></table>

例如，您想获取此图像链接：

<figure><img src="/files/EF7hbNLx8WSlF118FKTK" alt=""><figcaption></figcaption></figure>

您需要输入此图像元素的 CSS 选择器并输入属性名称，此处此图像的属性名称为 src&#x20;

<figure><img src="/files/APyqQnISZrof8NaRqC1y" alt=""><figcaption></figcaption></figure>

然后您获取图像属性的值并将其存储在变量中。


---

# 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.hidemium.io/zi-dong-hua-yong-hu-shou-ce/shu-ju-data/huo-qu-shu-xing-zhi-get-attribute-value.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.
