Reputation: 3067
I can't really understand iMacros syntax.
What I'm trying to do.
1) Go to first page of my blog
2) Find link containing word "post"
3) Go to link found on step 2
4) Return to previous page
5) Find another same link
6) If no same links, find link with "next" word (it means next page)
7) Go to that page
8) Return to step 2
sounds like a plan. Then script will open all posts on page, save them and go to another page.
How can I do this? I tried something with TAG and POS attributes, but they show only errors
Upvotes: 2
Views: 2817
Reputation: 3547
You've got it wrong. iMacros CAN'T do that. iMacros can't do IF clauses. For that you have to use JavaScript scripting.
1) Go to first page of my blog 2) Find link containing word "post" 3) Go to link found on step 2 4) Return to previous page 5) Find another same link 6) If no same links, find link with "next" word (it means next page) 7) Go to that page 8) Return to step 2
This is what you are asking.
var macro;
macro ="CODE:";
macro +="URL GOTO=www.myblog.com"+"\n";
var macro1;
macro1 ="CODE:";
macro1 +="TAG POS=1 TYPE=A ATTR=TXT:*post* EXTRACT=HREF"+"\n";
var macro2;
macro2 ="CODE:";
macro2 +="URL GOTO={{link}}"+"\n";
var macro3;
macro3 ="CODE:";
macro3 +="TAG POS=1 TYPE=A ATTR=TXT:*next* EXTRACT=HREF"+"\n";
//go to link
iimPlay(macro)
//extract the link on page with text post
iimPlay(macro1)
var link=iimGetLastExtract();
//if there is such a link go to it
if(link!="#EANF#")
{
iimSet("link",link)
iimPlay(macro2)
}
//go to previous page
iimPlay(macro)
//extract the link with text post
iimPlay(macro1)
link=iimGetLastExtrac();
//if there is not a link like that extract link with text next
if(link=="#EANF#")
{
//extract link with text next
iimPlay(macro3)
var next_link=iimGetLastExtract();
//if there is a link with text next navigate to it
if(next_link!="#EANF#")
{
//navigate to link with text
iimSet("link",next_link)
iimPlay(macro2)
}
}
So try working on this and you will get the answer to your macro. And this has to be placed in .js file and NO OTHER EXTENSION!
Upvotes: 2