开发者

How to step 2 with iMacros loop? How to select every other href?

I have this iMacros code fragment

VERSION BUILD=7200328 RECORDER=FX
TAB T=1
URL GOTO=http://feedburner.google.com/fb/a/myfeeds
SET !LOOP 1
TAG POS={{!LOOP}} TYPE=A ATTR=HREF:http://feedburner.google.com/fb/a/dashboard?id=*
TAG POS=1 TYPE=A ATTR=TXT:Publicize
TAG POS=1 TYPE=SPAN ATTR=TXT:Socialize
TAG POS=1 TYPE=SELECT FORM=NAME:editFeedActionForm ATTR=ID:postFields CONTENT=$Title<SP>and<SP>Body
WAIT SECOND开发者_JAVA技巧S=2
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ID:mainForm ATTR=VALUE:Save
TAG POS=1 TYPE=A ATTR=TXT:FeedBurner

The above script will extract hrefs that match the http://feedburner.google.com/fb/a/dashboard?id=* rule, and will try to navigate further on the page.

However there are two links on the page with the same stuff and I want to loop only odd values. Like 1,3,5,7 how to set a custom step value for loop?


Such simple arithmetic can also be done in the iMacros language:

'Store the value of !loop in a variable
SET !VAR1 {{!LOOP}}
ADD !VAR1 {{!LOOP}}
'now !var1 = 2*!loop. Subtract 1 to get odd numbers.
ADD !VAR1 -1
TAG POS={{!VAR1}} TYPE=A ATTR=HREF:http://feedburner.google.com/fb/a/dashboard?id=*

Regards,

Marcia

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜