monKaster wrote: ↑Mon Dec 27, 2021 9:21 pm
Hello, Thank you for your reply.
I have changed the title of the thread.
I thought the right place was the firefox sub-forum because I use imacros on a firefox.
Finally, the reason. Badoo is a dating or friendship site. To start a chat there are two options: Pay or click "like" on each person's profile. If the other person "like" back, then you can chat for free.
Clicking "like" is a positive action. You indicate that you "like". It is not hate, not hostile. I mean that clicking "like" is not a negative action in any way.
However, I leave it up to you to consider helping me. Thank you
Alright, Thanks for changing the Thread Title, and the new Title makes "more sense" indeed than my suggested one, when one knows that 'Badoo' Site or after the Explanation that you gave...
I "vaguely" knew the Name, but I didn't know it was a Dating Site, ah-ah...!
Then OK, I find your "Scenario" perfectly "legit" for "a little bit of Automation" indeed, even if it now feels like you are a bit "pretty desperate" in Love/Friendship if you want to click on all the Profiles, ah-ah...!
Alright the high "POS=n" (= "POS=77" / "POS=95" / etc...) you are getting from your recorded Actions are because those 'Like' Buttons do not have any Text associated with them (=> hence the (empty) "TXT:" Attribute for the `ATTR` Param), they are Images (probably '.png' Files) located "inside" the clickable `DIV` that iMacros "sees" and records...
When dealing with high POS_Nb's, there are usually 2 Techniques:
-1 Try to identify and to use some other Attribute(s) than the 'TXT' one for which the "only Info" you and iMacros have is that it must be empty, but there are apparently many-many such Icons and mini "empty" DIV's on the Page, and probably repeated for each Profile displayed on the Page.
=> You could try selecting the 'Use Full HTML Mode' ('Conventional 'TAG' Mode') in the Recording Options. See if iMacros is able to record some more "useful" Attribute(s) than the 'TXT' one, like the 'CLASS' (="encounters-actions__item encounters-actions__item--yes" from the mini-Source Excerpts you've posted...?), or the 'ID' if it's not "Dynamic".
If the 'Full HTML Mode' doesn't really help, then you would need to record clicking on one specific 'Like' Button, which will for example record:
You change this recorded Statement to:
Code: Select all
TAG POS=85 TYPE=DIV ATTR=TXT: EXTRACT=HTM
While in Edit Mode for the Script, you also comment out the 'URL GOTO' that iMacros will have recorded, because when you'll be running that mini-Script, you don't want iMacros to reload the Page, or the Content might change, and the POS_Nb's might change also and "POS=85" might then either not be found anymore, or correspond to some "other" 'DIV'/Icon on the Page...
Then you "manually" undo the 'Like' Action on that Profile, and you can run this mini-Script, and the 'EXTRACT_POPUP' will give you the Source Code of that 'Like' Button and the whole 'DIV'.
From this Popup, you should be able to identify some "other" Attribute(s) than the 'TXT' one (which will be empty anyway) and that will be more "unique" on the Page for each 'Like' Button...
=> If the 'CLASS' I mentioned is the correct one for those 'Like' Buttons, that would then give for example:
Code: Select all
TAG POS=1 TYPE=DIV ATTR=TXT:&&CLASS:"encounters-actions__item encounters-actions__item--yes"
And that Statement could then be looped with:
Code: Select all
TAG POS={{!lOOP}} TYPE=DIV ATTR=TXT:&&CLASS:"encounters-actions__item encounters-actions__item--yes"
If you don't want to click on the "wrong" Buttons/Icons, in case the 'CLASS' is "wrong", or the same 'CLASS' is also used for "other" Buttons/Icons, you could first loop 3 times for example the following mini-Script:
Code: Select all
SET !TIMEOUT_STEP 1
TAG POS={{!lOOP}} TYPE=DIV ATTR=TXT:&&CLASS:"encounters-actions__item encounters-actions__item--yes" EXTRACT=HTM
PROMPT LOOP:<SP>_{{!LOOP}}_<BR><BR>EXTRACT:<BR>_{{!EXTRACT}}_
... and "verify" that "LOOP=1" corresponds to the 'Like' Button for 'Profile_1', "LOOP=2" for 'Profile_2', etc...
-2 The 2nd Technique to use for high "POS=n" is otherwise to use 'Relative Positioning' if you can identify (and tag) some HTML Element that will be (more) unique for each Profile and that could be used as 'Anchor' to be looped, while the 'R-POS' for the Click on the 'Like' Button will remain constant, and "hopefully" "POS=R1", but even if "POS=R1" is not correct, maybe it is "POS=R3", but the "POS=R3" will remain constant for all Profiles...
>>>
monKaster wrote: ↑Sun Dec 26, 2021 10:48 pm
The button is always in the same position on the screen. I don't know if you can click on specific coordinates, for example. Or on a button with certain colors?
"button with certain colors":
=> In some Cases yep, but not in this one, a Colour Attribute can be used on Text, while the 'TXT' Attribute on this Page for this Button is empty, and the Button/Icon itself is an Image...
But the URL/'HREF' Attribute of that Image could be used indeed, as I reckon it will be same URL for all 'Like' Buttons, but hum..., probably a bit more "complicated" to implement than the other Techniques I mentioned...
"The button is always in the same position on the screen. I don't know if you can click on specific coordinates":
=> Ah...!, that could be an "Option" indeed, and maybe even a "good Idea" actually...:
There are 2 Ways/Modes to click with Coordinates:
-1 Using the 'X/Y CLICK' Mode from the Recording Options. And this is the "Solution"/Implementation I mentioned that would be specific to your v8.9.7 Version for FF, as this Mode is not supported anymore in all Versions released after v8.9.7.
But hum, I've always tried to "avoid" this Mode that I've never found very "reliable", + your Browser Window will always need to have the same Size...
-2 The 2nd Way is to use the 'EVENT' Mode to record a "slow" Click on the 'Like' Button...
=> Then instead of recording one 'CLICK' Statement, iMacros will then record 3 Statements, with a `MOUSEDOWN` + `MOUSEMOVE` (of just a few Pixels) + `MOUSEUP`. And the last 2 recorded Statements do use Coordinates indeed... That could work... But I'm not sure if the `SELECTOR` Param for the `MOUSEDOWN` will remain "constant", and you cannot "easily" loop a Script with the 'EVENT' Mode... (even if I have a Workaround for that...).
... But the "standard" 'EVENT' Mode could also be an Option, with or without the "Favor element ids in selectors" Setting, but you will then encounter the same "Difficulties" I mentioned about looping a Script in 'EVENT' Mode...
OK, "good Luck", I think I gave you all Info on how to implement the Func that you want..., and "good Luck" also with finding Love or Friendship on that Site, ah-ah...!
... And post your Script once you'll have managed to get it to work, maybe some other Users will find it useful also..., and/or follow up if you get "stuck" somewhere...
>>>
And I moved the Thread to the 'General' Sub-Forum...
- (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...