如何在iMacros中设置循环? [英] How to set a loop in iMacros?

查看:705
本文介绍了如何在iMacros中设置循环?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个下面给出的宏 -

I have written a macro given below-

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

在循环的每次迭代中,只有'TBODY> TR中的值:nth-型(XXX)'的变化。 XXX的值范围从1到150.
我应该如何将其转换为循环,以减少代码行数并提高可读性。

In each iteration of loop , only the value in 'TBODY>TR:nth-of-type(XXX)' changes. The value of XXX ranges from 1 to 150. How should I convert this into a loop so as to reduce lines of code and improve readibility.

我发现!LOOP函数可以在iMacros中使用,但是我无法解决它的语法问题。请帮助我。

After a bit of research, I found that !LOOP function can be used in iMacros, but I'm unable to get around its syntax. Help me out, please.

推荐答案

尝试重复播放此宏

(当前:1最大值:150,'Play Loop '按钮):

Try to play this macro repeatedly
(Current: 1 Max: 150, the 'Play Loop' button):

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

这篇关于如何在iMacros中设置循环?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆