如何在 iMacros 中设置循环?
How to set a loop in iMacros?
我写了下面给出的宏-
VERSION BUILD=844 RECORDER=CR
URL GOTO=https://example.com/form.aspx
WAIT SECONDS= 4
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(195)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(196)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(197)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(198)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(199)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
在 loop 的每次迭代中,只有 'TBODY>TR:nth-of-type(XXX)' 中的值发生变化。 XXX 的取值范围为 1 到 150。
我应该如何将其转换为循环以减少代码行数并提高可读性。
经过一些研究,我发现 !LOOP 函数可以在 iMacros 中使用,但我无法绕过它的语法。请帮帮我。
尝试反复播放这个宏
(当前:1 最大:150,'Play Loop' 按钮):
SET url https://example.com/form.aspx
SET url EVAL("({{!LOOP}} == 1) ? '{{url}}' : 'javascript: undefined;';")
URL GOTO={{url}}
SET firstWait EVAL("({{!LOOP}} == 1) ? '4' : '0';")
WAIT SECONDS={{firstWait}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type({{!LOOP}})>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS=15
我写了下面给出的宏-
VERSION BUILD=844 RECORDER=CR
URL GOTO=https://example.com/form.aspx
WAIT SECONDS= 4
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(195)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(196)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(197)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(198)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type(199)>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS= 15
在 loop 的每次迭代中,只有 'TBODY>TR:nth-of-type(XXX)' 中的值发生变化。 XXX 的取值范围为 1 到 150。 我应该如何将其转换为循环以减少代码行数并提高可读性。
经过一些研究,我发现 !LOOP 函数可以在 iMacros 中使用,但我无法绕过它的语法。请帮帮我。
尝试反复播放这个宏
(当前:1 最大:150,'Play Loop' 按钮):
SET url https://example.com/form.aspx
SET url EVAL("({{!LOOP}} == 1) ? '{{url}}' : 'javascript: undefined;';")
URL GOTO={{url}}
SET firstWait EVAL("({{!LOOP}} == 1) ? '4' : '0';")
WAIT SECONDS={{firstWait}}
EVENT TYPE=CLICK SELECTOR="HTML>BODY>FORM>DIV:nth-of-type(4)>DIV>DIV:nth-of-type(3)>DIV>DIV>DIV>DIV:nth-of-type(4)>TABLE:nth-of-type(2)>TBODY>TR:nth-of-type({{!LOOP}})>TD:nth-of-type(4)>SPAN:nth-of-type(2)>I" BUTTON=0
WAIT SECONDS=15