green.pine wrote:Thanks for reply;
Eval is not an easy task for me, I did go through all the Eval example, but could not understand how to make it start my macro to start over, except Loop, and I don't understand the usage of Modulo,
I manage to set new number (1) to the loop, but I guess I am wrong, because it does nothing.
anyhow this is what i could do, it runs as before, it seems this code does nothing to the whole thing.
Code: Select all
TAG POS=1 TYPE=A ATTR=ID:PNNEXT EXTRACT=TXT
TAG POS=1 TYPE=A ATTR=ID:PNNEXT
SET Start_Over EVAL("var s='{{!EXTRACT}}'; var x,y,z; if(s!=='next'){z=1;} else{z=0;}; z;")
SET !TIMEOUT_STEP {{Start_Over}}
SET !LOOP {{Start_Over}}
do you help me with this to make it work,
thanks
"Eval is not an easy task for me, I did go through all the Eval example[s]...", tja 1 'EVAL()' Statement = 1 (compact) JavaScript Statement and you each time want to use '.js' Scripts, ah-ah...!
Euh, which "all the Eval example[s]"...?, my previous Reply was about "Nested Loops" (and 'Modulo'), but the 'EVAL)' Statement you posted in your Script and tried to modify has nothing really related to "Nested Loops"... The Maths Mechanism for Nested Loops is a bit different than the Base_2 Model I used for some previous Implementation in your Thread for the 'POS=n'...
Post a Link or quote which Thread(s) you use as Ref for Nested Loops.., but hum..., it's not complicated at all, some simple Maths that all Kids learn when they are 10-12-14 years old at school...
But hum, yep about your Try..., hum-hum..., yep-yep..., you are a little-little bit in the good Direction, even if I'm not sure what you expect from 'LOOP=0'...!?, oops...!, but more important to know is that you can only use 'SET 'LOOP' once and it gets read by iMacros on the first Loop ONLY, and it is ignored on the Loops after... => You cannot use Raw '!LOOP' directly, but you'll need to compute your own 'MyLoop', based on '!LOOP' indeed.
it took me a mini-while to understand the Mechanism, but it's cleverly logical actually... Easy Explanation is that 'SET !LOOP 2' (instead of '...=1' which is the Default) is meant to tell your Macro to start looping through your DataSource from Row_2, to avoid the Table Header. If iMacros was still reading the 'SET !LOOP 2' Statement on each Loop, it would start over again and again from Row_2 and would never check the next Rows, ah-ah, oops...! => The clever Solution by Design is to read the '!SET LOOP' Statement only on the first Run of the Macro...!
And hum, you'll need to think about how you want to handle the inner Loop for the say 6 Search Pages for each Keyword..., 3 Cases...:
- Either all your Searches will always yield at least 6 Pages of Results... => Inner_Loop=6. (Fixed, "Standard" Nested Loop...)
- Or some Searches might yield less than 6 Pages, but you don't mind "losing" 1-2 min for some "fake" Extract and Check on TAB_2 for no Data... => Inner_Loop=6 (Fixed forced...!) But hum, the "1-2 min" can be drastically reduced to maybe 1-2 sec, using the same Mechanism I used for your '!TIMEOUT_STEP'...
- Or for the "shorter" Searches that might yield less than 6 Pages, if you don't want to "wait" for the sometimes 2 "fake" Pages, (Inner Loop not fixed), you'll need a Mechanism for your Script to know to then jump at that moment from say '!DATASOURCE_LINE=6' to '...=7'..., using a Temp mini-'SAVEAS' that will also be a Secondary DataSource for the same Script (hum..., I wouldn't be surprised if I had lost you here, ah-ah...!!), or the Input Field on your TAB_2 for example, but that would imply an extra Check on TAB_2 at the beginning of each Loop, or the Google Search Input Field on TAB_1 could also be "misused" for the same Purpose, ah-ah..., is also a Possibility... (And there are probably others, as I already mentioned in some previous Thread, your Creativity is "the Limit", but don't worry, good News is that everything is always possible...
)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE'/'Trial').
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...