tobiashansen wrote: ↑Mon Jun 29, 2020 8:44 am
Hi Chivracq, thanks a lot for your 3 solutions. I tried them all and the 3rd one was indeed working perfectly
Code: Select all
TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=MOUSEOVER
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SET !VAR1 {{!EXTRACT}}<BR>
SET !EXTRACT {{!VAR1}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv
Good that is was rather a bug than my code. I tried over and over again but now it is indeed saving each loop extract into one line, no need to even use a dummy column.
Another problem I am facing and I don't think it is another bug it is probably me having a wrong logic. I use different PROMPTs to debug and always ending up the same, the LOOP iteration does not take the extract from the current one but the next.
Ok, more concrete, let's say I have 3 links in a website called alpha, beta, gamma
The loop shows me in the prompt that the current loop extract variable is indeed set to alpha but when it comes down to SAVEAS, instead of grabbing alpha, it grabs beta and so on. That means my entire logic of the loop is working all the way to select the right record but SAVEAS takes LOOP+1.
Would you be able to have a look if I post my full script with sample extract values?
OK, good-good..., (about the Line Break)...
And, yep of course you can post your Script and I can have a Look, but I reckon, that won't be necessary, ah-ah...!
Well the 'SAVEAS' will save the Content of the '!EXTRACT' Var "at that moment", and you can put a 'PROMPT' just before doing the 'SAVEAS' to debug and check its Content, stg like...:
Code: Select all
TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=MOUSEOVER
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SET !VAR1 {{!EXTRACT}}<BR>
SET !EXTRACT {{!VAR1}}
PROMPT EXTRACT:<BR><BR>_{{!EXTRACT}}_
PAUSE
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv
Oh...!, hum, and I think you'll be seeing another Bug from v10.0.x for CR/FF, the "<BR>" Tags do not "act" like '<BR>' but like '<SP>' in a 'PROMPT', tja...!
And I guess you will see that your 'EXTRACT' "already" contains the "Next" Link...
This is because you are using 'Relative Positioning' for the 'EXTRACT=HREF', and your Anchor is a 'DIV', but the Link is located "
inside" that 'DIV', which means that with 'R-POS', iMacros will start looking
after the 'DIV', and cannot look
inside...
=> You then need to use 'Double Relative Positioning', with stg like...:
Code: Select all
TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=MOUSEOVER
TAG POS=R-1 TYPE=* ATTR=* EXTRACT=TXT
SET !EXTRACT NULL
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SET !VAR1 {{!EXTRACT}}<BR>
SET !EXTRACT {{!VAR1}}
PROMPT EXTRACT:<BR><BR>_{{!EXTRACT}}_
PAUSE
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv
Well, you can choose which Order works best between 'R-1' + 'R1' or 'R1' + 'R-1'...
The 'EXTRACT=TXT' is "fake" and maybe not necessary, and just in case that Intermediary Element is clickable...
Because of the 'CONTENT=MOUSEOVER' on the 'Anchor', I am/was a little bit afraid that iMacros might not be able to "see" the Link anymore as the 'TAG POS=R-1' will probably dismiss the MouseOver, but if iMacros is able to "catch" the Next Link, which is probably not "visible" itself at that moment, then I think, it should still work, and iMacros will still be able to see/catch the "good Link" from the Source even if you don't see it in the Browser...
(... Which I guess would mean the "CONTENT=MOUSEOVER" is probably not even needed on the 'Anchor'..., iMacros "sees" it already from the Source...)
>>>
EDIT:
And hum, some mini-Rmk, but I was not really "awake"...
, but hum, your "CONTENT=MOUSEOVER" is "weird"..., it won't be "doing" anything actually, and I'm nearly surprised it doesn't trigger some Error, as the Syntax is incorrect, ah-ah...! Here is the
correct Syntax:
Code: Select all
TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=EVENT:MOUSEOVER
Then "again", that means it is not needed indeed like I "suspected", you can remove that 'CONTENT' Param when tagging the 'Anchor'..., the "TAG POS={{!LOOP}}" is already doing the Job by itself...
- (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...