4

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 SECONDS=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?

Pentium10
  • 204,586
  • 122
  • 423
  • 502

1 Answers1

6

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

mflips
  • 321
  • 2
  • 3
  • + Similar Thread on the iMacros Forum, where I had also given the exact same Solution, ah-ah...!: [Re: how to loops by odd numbers?] [1]: https://forum.imacros.net/viewtopic.php?f=2&t=30668&p=86275#p84001 – chivracq Oct 21 '20 at 02:39