Search code examples
loopsvariablesfirefoxpositionimacros

Click on Successive Links Using IMacro


I am trying to write a macro to add a digit to POS= after each loop, so that it clicks on successive links in my search results in http://www.presidency.ucsb.edu/ws/index.php (type in any keyword under "Search the Entire Document Archive). I did something very similar to the user from imacro increase attr=id by one digit after every loop

My code works, but the macro starts clicking from the third search result onward. I have changed POS= 1,2,3 but anything less than POS=4 ends up clicking on sidebars, not the search results. What should I change to get the macro to start clicking from the first search result? Thanks for any insight!

set !var1 1
add !var1 {{!LOOP}}
TAG POS=4{{!var1}} TYPE=A ATTR=TXT:*
BACK

Solution

  • The links you are trying to click on all have a class with value "listLink" so if you include that in the tag logic you should be able to bypass the sidebar links.

    TAG POS={{!LOOP}} TYPE=A ATTR=CLASS:listLink
    BACK