> 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/qi-ta-other/for.md).

# For

此按钮允许您选择循环类型：数据、元素、或在脚本中重复特定操作或处理特定次数。

## For Data

<figure><img src="https://699023340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiEhmc20xmuwcG5ThYMWS%2Fuploads%2FnrVHtXPfBm0Pd0Kg0m1f%2Fimage.png?alt=media&amp;token=bb35cf38-9e90-4165-961b-aea8b83bc54e" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="258">参数</th><th>说明</th></tr></thead><tbody><tr><td>For from value</td><td>输入数值或选择包含有效值的变量</td></tr><tr><td>For to value</td><td>输入数值或选择包含有效值的变量</td></tr></tbody></table>

For to value 的值必须大于 For from value 的值

{% file src="/files/CHREfPgc4Di8lPC3276Y" %}

## For Elements

您可以输入要循环的元素的 CSS 选择器。您可以选择在每个循环中提取的内容并将其保存到变量中。

<figure><img src="https://699023340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiEhmc20xmuwcG5ThYMWS%2Fuploads%2FzEObUM2aIgpQ7zEr2VPC%2Fimage.png?alt=media&amp;token=69830098-5572-4655-b4a9-61e32f0f2280" alt=""><figcaption></figcaption></figure>

**Selector element**：输入CSS选择器，例如#email、\[data-results-grid-container]>li

**Content**：选择提取类型，包括：

* Text：提取您选择的元素的文本
* HTML：提取您选择的元素的 HTML
* Attribute：提取元素的属性，输入要提取的属性。

**Loop object save to**：将每次循环提取的网页元素保存为变量。

**Loop index save to**：将每次循环中提取的网页元素的位置保存到变量中。请注意，循环中网页元素的位置（索引）从 0 开始。

{% file src="/files/wZZAZC0VXVaHWEYOxHLZ" %}

## For Times

当选择For Times时，您可以输入您想要的迭代次数。

<figure><img src="https://699023340-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiEhmc20xmuwcG5ThYMWS%2Fuploads%2FosmhakOnDVeTFQ0QSKLg%2Fimage.png?alt=media&amp;token=4a85363d-eeae-471a-9fa0-369a641a6cc1" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="258">参数</th><th>说明</th></tr></thead><tbody><tr><td>Times</td><td>输入所需的迭代次数，最多 99。</td></tr><tr><td>Loop index save to</td><td>将每次循环中提取的网页元素的位置保存到变量中。注意循环中网页元素的位置（索引）从1开始。</td></tr></tbody></table>

{% file src="/files/mvYBoILfsXyUUppNd3ti" %}
