Selecting a specific range of my pinterest followers to follow back

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Tue Jun 23, 2020 7:33 am

Imacros Paid Personal Edition Version 10.0.2.1450 Last Updated June 20, 2020
Firefox 77.0.1 (64-bit)
Windows 10 (64-bit)
All demo macros work fine


I have tried relentlessly over the past week to adjust my script so it only scrapes followers that themselves have at least a certain amount of followers. One of my accounts get spammed persistent and I simply need to filter out the noise from real meaningful followers

The following script does in fact work quite well down only to one problem, the loop. It runs fine all the way to the extract tag position and than instead of grabbing the actual tag of the current loop it somehow takes the next one instead. I even utilized the great idea about the loop-switch posted in the forum to jump out if a condition is not met

What it currently does is to filter out all my followers that have themselves at least 400+ followers and writes it into the csv file. Perhaps CONTENT=MOUSEOVER is wrong but I am not sure.

PROBLEM 1: the first TAG POS is working correctly, however further down the TAG POS should still be in the same LOOP iteration but it is not, it is taking the next found TAG instead.

PROBLEM 2: SAVEAS EXTRACT does not write the extract each into a new line inside the csv file but simply all into one line.

I would greatly appreciate some help to hopefully get it solved as I am out of ideas on this one. Thank you


Code: Select all

VERSION BUILD=10021450
SET !VAR0 400
TAB T=1
url goto=javascript:window.scrollBy(0,0)
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !TIMEOUT_MACRO 10

TAG POS={{!LOOP}} TYPE=DIV ATTR=class:"tBJ dyH iFc yTZ pBj tg7 IZT swG" EXTRACT=TXT

SET !VAR1 EVAL("var x=\"{{!EXTRACT}}\"; x=x.replace(/\\D+/g,\"|\");")

SET !VAR2 EVAL("var s='{{!VAR1}}'; var x,y,z; x=s.split('|'); y=x[1]; z=y.trim(); z;")

SET !EXTRACT NULL
SET LOOP_Switch EVAL("var s=\"{{!VAR2}}\", d = parseFloat(s); if(d < {{!VAR0}}){n=1;} else{n='0';}; n;")
SET !TIMEOUT_STEP {{LOOP_Switch}}

TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=MOUSEOVER
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv
Last edited by tobiashansen on Fri Jun 26, 2020 6:26 am, edited 1 time in total.
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Wed Jun 24, 2020 5:14 am

lots of people view it and nobody has an answer... hmmh...I will also keep trying to solve it. the second problem I mentioned, I wonder, is it actually a bug? Isn't SAVEAS supposed to automatically save the current extract within a LOOP into a new line in the csv file?

TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=MOUSEOVER
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv


The first problem I will most likely solve, time comes but I am definitely stuck on that one here
Last edited by tobiashansen on Fri Jun 26, 2020 6:26 am, edited 1 time in total.
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Wed Jun 24, 2020 11:12 am

not a clean way of doing, but "ADD !EXTRACT <BR>" is basically giving me the line break but in parenthesis that would need further cleaning. I thought SAVEAS where supposed to make a line break every time it is called?
Last edited by tobiashansen on Fri Jun 26, 2020 6:26 am, edited 1 time in total.
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Fri Jun 26, 2020 6:24 am

Would be nice if someone could explain it. I have worked around a few things in the meantime, it still boils down to the fact that

1. SAVEAS does not save into a newline but simply all into one without any delimiter since I can't change the global setting for csv under imacro extension option, the way it was explained in one post. There is simply no option to set.

2. THE TAG POS inside the loop does not take the very first occurrence but the 2nd and goes on from there

Code: Select all


VERSION BUILD=10021450
TAB T=1
url goto=javascript:window.scrollBy(0,0)
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !TIMEOUT_MACRO 10


TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep"
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
ADD !EXTRACT <BR>

PROMPT LOOP:<SP>_{{!LOOP}}_<BR>VAR1:<SP>_{{!VAR1}}_<BR>VAR2:<SP>_{{!VAR2}}_<BR>EXTRACTTYPE:<SP>_{{theextract}}_<BR>EXTRACT:<SP>_{{!EXTRACT}}

SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=test.csv

tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Fri Jun 26, 2020 8:05 am

nobody seem to care in this community but I got it to work now with a workaround. I simply start with set loop position 2 and evaluate the condition of the loop to set it back by 1 or keep the current loop. the extraction parameters and POS=R1 where correctly set and now it executes just perfectly under any condition I need. Also I simply add extract <BR> works for me and I automatically clean the file with excel formulas.

Ok, it's done
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Fri Jun 26, 2020 11:18 am

still I am quite impressed with the sheer possibilities of automation and the valuable examples to be found here.
chivracq
Posts: 9494
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Selecting a specific range of my pinterest followers to follow back

Post by chivracq » Fri Jun 26, 2020 6:59 pm

tobiashansen wrote:
Tue Jun 23, 2020 7:33 am
Imacros Paid Personal Edition Version 10.0.2.1450 Last Updated June 20, 2020
Firefox 77.0.1 (64-bit)
Windows 10 (64-bit)
All demo macros work fine


I have tried relentlessly over the past week to adjust my script so it only scrapes followers that themselves have at least a certain amount of followers. One of my accounts get spammed persistent and I simply need to filter out the noise from real meaningful followers

The following script does in fact work quite well down only to one problem, the loop. It runs fine all the way to the extract tag position and than instead of grabbing the actual tag of the current loop it somehow takes the next one instead. I even utilized the great idea about the loop-switch posted in the forum to jump out if a condition is not met

What it currently does is to filter out all my followers that have themselves at least 400+ followers and writes it into the csv file. Perhaps CONTENT=MOUSEOVER is wrong but I am not sure.

PROBLEM 1: the first TAG POS is working correctly, however further down the TAG POS should still be in the same LOOP iteration but it is not, it is taking the next found TAG instead.

PROBLEM 2: SAVEAS EXTRACT does not write the extract each into a new line inside the csv file but simply all into one line.

I would greatly appreciate some help to hopefully get it solved as I am out of ideas on this one. Thank you


Code: Select all

VERSION BUILD=10021450
SET !VAR0 400
TAB T=1
url goto=javascript:window.scrollBy(0,0)
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !TIMEOUT_MACRO 10

TAG POS={{!LOOP}} TYPE=DIV ATTR=class:"tBJ dyH iFc yTZ pBj tg7 IZT swG" EXTRACT=TXT

SET !VAR1 EVAL("var x=\"{{!EXTRACT}}\"; x=x.replace(/\\D+/g,\"|\");")

SET !VAR2 EVAL("var s='{{!VAR1}}'; var x,y,z; x=s.split('|'); y=x[1]; z=y.trim(); z;")

SET !EXTRACT NULL
SET LOOP_Switch EVAL("var s=\"{{!VAR2}}\", d = parseFloat(s); if(d < {{!VAR0}}){n=1;} else{n='0';}; n;")
SET !TIMEOUT_STEP {{LOOP_Switch}}

TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=MOUSEOVER
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv
tobiashansen wrote:
Wed Jun 24, 2020 5:14 am
lots of people view it and nobody has an answer... hmmh...I will also keep trying to solve it. the second problem I mentioned, I wonder, is it actually a bug? Isn't SAVEAS supposed to automatically save the current extract within a LOOP into a new line in the csv file?

TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=MOUSEOVER
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv


The first problem I will most likely solve, time comes but I am definitely stuck on that one here
tobiashansen wrote:
Wed Jun 24, 2020 11:12 am
not a clean way of doing, but "ADD !EXTRACT <BR>" is basically giving me the line break but in parenthesis that would need further cleaning. I thought SAVEAS where supposed to make a line break every time it is called?
tobiashansen wrote:
Fri Jun 26, 2020 6:24 am
Would be nice if someone could explain it. I have worked around a few things in the meantime, it still boils down to the fact that

1. SAVEAS does not save into a newline but simply all into one without any delimiter since I can't change the global setting for csv under imacro extension option, the way it was explained in one post. There is simply no option to set.

2. THE TAG POS inside the loop does not take the very first occurrence but the 2nd and goes on from there

Code: Select all


VERSION BUILD=10021450
TAB T=1
url goto=javascript:window.scrollBy(0,0)
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !TIMEOUT_MACRO 10


TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep"
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
ADD !EXTRACT <BR>

PROMPT LOOP:<SP>_{{!LOOP}}_<BR>VAR1:<SP>_{{!VAR1}}_<BR>VAR2:<SP>_{{!VAR2}}_<BR>EXTRACTTYPE:<SP>_{{theextract}}_<BR>EXTRACT:<SP>_{{!EXTRACT}}

SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=test.csv
tobiashansen wrote:
Fri Jun 26, 2020 8:05 am
nobody seem to care in this community but I got it to work now with a workaround. I simply start with set loop position 2 and evaluate the condition of the loop to set it back by 1 or keep the current loop. the extraction parameters and POS=R1 where correctly set and now it executes just perfectly under any condition I need. Also I simply add extract <BR> works for me and I automatically clean the file with excel formulas.

Ok, it's done
tobiashansen wrote:
Fri Jun 26, 2020 11:18 am
still I am quite impressed with the sheer possibilities of automation and the valuable examples to be found here.

Alright, quoting your 5 previous Posts all together ah-ah...!

And hum, mini-Compliment for the Quality of your Thread and the "Follow-up", on yourself...! :P :D

"lots of people view it and nobody has an answer... hmmh..." + "nobody seem to care in this community"
=> Yeah, well, I'm usually the most active Helper on the Forum, but I don't help for "everything" and I actually don't help for Social Media and Like/Follow/Comment/etc... (nor for Games/Votes/Spam/Captcha/Bitcoin/Financial Gain/Competition and a few other other "Areas" for which I "ethically" refuse to "help", from a personal Point of View...). :(

But hum, "nobody seem to care in this community", this is though a little bit True indeed among Users using iMacros for Social Media (and all Areas I mentioned), they "all" want to be "the Best" and "beat the Competition" and they usually don't "help" each other and don't like to share their Scripts to help the Competition..., and even usually delete or mutilate all their Thread/Posts once they've got their Answer/Solution/Script working... (Reason I'm quoting the Thread also..., before you maybe want to do the same, ah-ah...! :shock: )

And hum, I've hardly had any Internet Connection since 6 days now, Pb with my Provider, Int. Co. stopped suddenly, Customer Service is unfriendly and completely useless and all my Credit vanished in 1 Sec... Still not solved, I'm now using some Neighbour's WiFi AP, but it's very weak and doesn't work very well...

But OK, from a quick Look, I saw that your Thread and all Posts was/were not only about Social Media, I'll have a look at those Parts/Functionality when I have a bit more reliable Co. again..., (but I'm trying to run a few of my own Scripts now, as I have a little bit of Internet, and I have a 6-day Backlog, oops!, and I still need to send some E-mail to that stupid CS...), and otherwise, even if I don't help you for this one, you "never know", maybe one day, I'll be "your best Friend", ah-ah...! :P
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Sun Jun 28, 2020 5:22 am

yes, browsing many topics, I have noticed that it is usually you who answers and also see how people disappear after they got what they want. Well, that's entirely not my personality. Unfortunately this mentality has gained foothold in most aspects of life and most people who cared before stopped caring now as they equally received that.

I can also understand why you requesting full config info, the imacro versions truly seem to have big differences in things that can be done. I wish I could still use .js files in my config but no. You explained that things can all be done in .iim files. Well, the main problem are loop iterations. I want only a part of my script to run the loop and read in variables in the beginning like in java. I am am not a programmer at all, very novice in what I do and that's why I create my workarounds.

Well still have one major problem and perhaps you have got an answer. Why is SAVEAS EXTRACT not saving each iteration within the LOOP into a new line inside the .csv file? I read imacros docu and that is how it is supposed to do it and going through other script samples it seems to be that way for many. Is there a bug in my config?

For the other things I can find workarounds but this requires manually editing the file every time the work is done instead of just being able to call another script and pick up where it left off.
chivracq
Posts: 9494
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Selecting a specific range of my pinterest followers to follow back

Post by chivracq » Mon Jun 29, 2020 2:04 am

tobiashansen wrote:
Sun Jun 28, 2020 5:22 am
yes, browsing many topics, I have noticed that it is usually you who answers and also see how people disappear after they got what they want. Well, that's entirely not my personality. Unfortunately this mentality has gained foothold in most aspects of life and most people who cared before stopped caring now as they equally received that.

I can also understand why you requesting full config info, the imacro versions truly seem to have big differences in things that can be done. I wish I could still use .js files in my config but no. You explained that things can all be done in .iim files. Well, the main problem are loop iterations. I want only a part of my script to run the loop and read in variables in the beginning like in java. I am am not a programmer at all, very novice in what I do and that's why I create my workarounds.

Well still have one major problem and perhaps you have got an answer. Why is SAVEAS EXTRACT not saving each iteration within the LOOP into a new line inside the .csv file? I read imacros docu and that is how it is supposed to do it and going through other script samples it seems to be that way for many. Is there a bug in my config?

For the other things I can find workarounds but this requires manually editing the file every time the work is done instead of just being able to call another script and pick up where it left off.

Alright, nice Reply... :D

OK, about mentioning the FCI, I actually gave yesterday some kind of "Explanation" => WHY, as a "simplified" :twisted: 4D or 5D Representation of the different Parameters/Vectors playing a Role in the following Thread... Interesting Reading maybe...

>>>

About the 'SAVEAS' not adding a Return Line between 2 Loops..., yep indeed, there was/is a Bug in some Version, and I guess that's the one you are using :oops: (=> v10.0.2 for FF), where there is no Line Break when saving only 1 Column.

Workarounds are to add a Dummy Col with:

Code: Select all

ADD !EXTRACT ""
... => with just an Empty String, or a Space, or a Dot... Or add a "useful" Col, either with a TimeStamp, or the Username, or the Loop_Nb... :idea:

... Other Workarounds are to include a Line Break in that first Col with "<BR>" or "\r" or "\n", a bit like you were doing with your:

Code: Select all

ADD !EXTRACT <BR>
... except "your" Workaround will actually add 2 Line Breaks, and not only 1.
That's because the 'ADD' Commands works differently on the '!EXTRACT' Var than on all other Vars, and "ADD !EXTRACT" always adds what gets added in a Next Col... If you want to manipulate the Content of the Extract without adding a New Col, you need to use some Temp Var like in:

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}}
ADD !VAR1 <BR>
SET !EXTRACT {{!VAR1}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private\Documents\iMacros\DataSources\ FILE=i-am-following.csv
This one is good also...:

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
@TechSup aware of the Bug, but because of the mitigating Workarounds, that didn't trigger a quick Fix, ah-ah...! :P

>>>

"I wish I could still use .js files in my config but no."
=> Yeah, well, you can still use v8.9.7 for FF which works until FF56, recommended FF v55.0.3 (Version I use myself), or also works on 'Pale Moon' (v28) or 'Basilisk' (v2019/v2020) which are "up-to-date" and regularly maintained, with Security Updates, etc... :idea:
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » 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?
chivracq
Posts: 9494
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Selecting a specific range of my pinterest followers to follow back

Post by chivracq » Mon Jun 29, 2020 4:21 pm

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...! :twisted:

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... 8)
(... 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"... :P , 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... 8)
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
tobiashansen
Posts: 9
Joined: Tue Jun 23, 2020 6:53 am

Re: Selecting a specific range of my pinterest followers to follow back

Post by tobiashansen » Tue Jun 30, 2020 6:22 am

chivracq, you rock...Only someone with deep inside knowledge of the functionality would even come up with such an idea. That basically means if I refer a DIV, I can't do negative positioning inside DIV, how about any other TAGS.

Anyway, it works perfectly now. I can't thank you enough for your robust help and explanation. I am sure I a going to use this sort of positioning "work-around" in many other instances.

Great help and all is done, it works

my final working code snippet looks like this

Code: Select all

TAG POS={{!LOOP}} TYPE=DIV ATTR=data-test-id:"user-rep" CONTENT=EVENT:MOUSEOVER
TAG POS=R-1 TYPE=* ATTR=* EXTRACT=TXT
SET !EXTRACT NULL
TAG POS=R1 TYPE=A ATTR=* EXTRACT=HREF
SET !VAR3 {{!EXTRACT}}<BR>
SET !EXTRACT {{!VAR3}}
SAVEAS TYPE=EXTRACT FOLDER=C:\Users\private.DESKTOP-FFPHPKD\Documents\iMacros\Macros\Pinterest\ FILE=2-Pinterest-iam-following.csv

Post Reply