how do i get imacros to adapt to nth-of-type change?

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
iMacros EOL - Attention!

The renewal maintenance has officially ended for Progress iMacros effective November 20, 2023 and all versions of iMacros are now considered EOL (End-of-Life). The iMacros products will no longer be supported by Progress (aside from customer license issues), and these forums will also no longer be moderated from the Progress side.

Thank you again for your business and support.

Sincerely,
The Progress Team

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
leemccarthyn
Posts: 1
Joined: Thu May 02, 2019 2:07 pm

how do i get imacros to adapt to nth-of-type change?

Post by leemccarthyn » Thu May 02, 2019 2:13 pm

I have a script running that posts comments on the same picture over and over on Instagram. Here is the script:

EVENT TYPE=CLICK SELECTOR="#user-content-posts>DIV>DIV>UL>LI>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>TEXTAREA" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#user-content-posts>DIV>DIV>UL>LI>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>TEXTAREA" CHARS=[comment]
EVENT TYPE=CLICK SELECTOR="#user-content-posts>DIV>DIV>UL>LI>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>BUTTON" BUTTON=0
WAIT SECONDS=60

The problem is whenever the profile uploads a new picture, >DIV:nth-of-type(3)> suddenly turns into >DIV:nth-of-type(2)> so my script is rendered useless and cannot find the correct comment box. In order to fix this I have to manually go in and change all the >DIV:nth-of-type(3)> to >DIV:nth-of-type(2)> so that iMacros is now selecting the proper comment box. When another picture is uploaded I then have to go back and change everything to how it was before.

How could I get around this and have it automatically adapt? Is there a way to tell iMacros to always select the first comment box on the page? If I don't use event mode I have found that the script does not run at all, this is in firefox
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: how do i get imacros to adapt to nth-of-type change?

Post by chivracq » Thu May 02, 2019 2:31 pm

leemccarthyn wrote:
Thu May 02, 2019 2:13 pm
I have a script running that posts comments on the same picture over and over on Instagram. Here is the script:

Code: Select all

EVENT TYPE=CLICK SELECTOR="#user-content-posts>DIV>DIV>UL>LI>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>TEXTAREA" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#user-content-posts>DIV>DIV>UL>LI>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>TEXTAREA" CHARS=[comment]
EVENT TYPE=CLICK SELECTOR="#user-content-posts>DIV>DIV>UL>LI>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>BUTTON" BUTTON=0
WAIT SECONDS=60
The problem is whenever the profile uploads a new picture, >DIV:nth-of-type(3)> suddenly turns into >DIV:nth-of-type(2)> so my script is rendered useless and cannot find the correct comment box. In order to fix this I have to manually go in and change all the >DIV:nth-of-type(3)> to >DIV:nth-of-type(2)> so that iMacros is now selecting the proper comment box. When another picture is uploaded I then have to go back and change everything to how it was before.

How could I get around this and have it automatically adapt? Is there a way to tell iMacros to always select the first comment box on the page? If I don't use event mode I have found that the script does not run at all, this is in firefox
(F)CIM...! :mrgreen: (Read my Sig...)

Yep, I can think of 3 Techniques (hum, 4 actually) to do what you want, and one I've already explained in 2 or 3 Threads previously... + another one that I have also "vaguely" mentioned/explained... (if you search the Forum a bit...)
But hum, you are a bit "out of luck" (with me), and I won't be more "precise", as I don't help for Social Media and Forums with Like/Follow/Comment... :shock:
But good luck anyway... :wink:
- (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...
Goldclownfish
Posts: 18
Joined: Mon Apr 29, 2019 3:50 am

Re: how do i get imacros to adapt to nth-of-type change?

Post by Goldclownfish » Mon May 13, 2019 4:17 am

This is the exact type of post that should have never been approved. I for one Do not ever approve of some spammer using imacros to generate hits on social media. This type of user is the same kind who also would use this software to flag an harass people.
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: how do i get imacros to adapt to nth-of-type change?

Post by chivracq » Mon May 13, 2019 4:59 am

Goldclownfish wrote:
Mon May 13, 2019 4:17 am
This is the exact type of post that should have never been approved. I for one Do not ever approve of some spammer using imacros to generate hits on social media. This type of user is the same kind who also would use this software to flag an harass people.
Yeah, well, iMacros is for Web-Automation, then it's no "wonder" that Spammers also use it for Spam... :oops:

I agree a bit with you, but as long as those "Users" "behave" and use our Forum "correctly", I have to "approve" their (first) Post (=> meaning they will become visible on the Forum), even if I'm myself completely Anti-Spam, Reason why I never help Users for Scripts related to [Spam/Hacking/DDOS/Games/Votes/Captcha/Forums/Social Media] with 'Like'/'Follow'/'Comment'... 8)
And maybe less than 25% of all new Posts reaching our Forum actually get approved... 8)

And "strangely enough" (but luckily...!), Users using iMacros for Social Media and fake Likes/Follow/Comments/etc never want to share their Script, always thinking they are the best and "Expert SEO", and don't want help the "Competition", ah-ah...! :roll:
- (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...
User avatar
thecoder2012
Posts: 446
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: how do i get imacros to adapt to nth-of-type change?

Post by thecoder2012 » Thu Jul 04, 2019 10:31 am

leemccarthyn wrote:
Thu May 02, 2019 2:13 pm
I have a script running that posts comments on the same picture over and over on Instagram. Here is the script:
Where? I see no full script as example (full script + htmlcode or url) in your post.
You have not really knowledge in imacros or programming language in my eyes.
chivracq wrote:
Mon May 13, 2019 4:59 am
Yeah, well, iMacros is for Web-Automation, then it's no "wonder" that Spammers also use it for Spam... :oops:
Suggestion: Videoident for iMacros download/buy :mrgreen:
chivracq wrote:
Mon May 13, 2019 4:59 am
And "strangely enough" (but luckily...!), Users using iMacros for Social Media and fake Likes/Follow/Comments/etc never want to share their Script, always thinking they are the best and "Expert SEO", and don't want help the "Competition", ah-ah...! :roll:
Oh I can post a script for protonmail but I think then is the service down. I have wrote it because the site says all is under control "Secure Email Based in Switzerland" but I have no pop3/imap access (export with the Bridge possible for Win/Mac) and I never trusted the site. But never used for spam or shared with other users. Proof of concept, it was too good. It works since years to grab and send my private emails with multiple accounts as my own pop3/imap bridge on my linux servers. :oops:
chivracq wrote:
Mon May 13, 2019 4:59 am
I never help Users for Scripts related to [Games/Votes/Captcha/Forums/Social Media] with 'Like'/'Follow'/'Comment'... 8)
But captchas are not broken, only the humans! :o
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: how do i get imacros to adapt to nth-of-type change?

Post by chivracq » Thu Jul 04, 2019 10:48 am

thecoder2012 wrote:
Thu Jul 04, 2019 10:31 am
leemccarthyn wrote:
Thu May 02, 2019 2:13 pm
I have a script running that posts comments on the same picture over and over on Instagram. Here is the script:
Where? I see no full script as example (full script + htmlcode or url) in your post.
You have not really knowledge in imacros or programming language in my eyes.
chivracq wrote:
Mon May 13, 2019 4:59 am
Yeah, well, iMacros is for Web-Automation, then it's no "wonder" that Spammers also use it for Spam... :oops:
Suggestion: Videoident for iMacros download/buy :mrgreen:
chivracq wrote:
Mon May 13, 2019 4:59 am
And "strangely enough" (but luckily...!), Users using iMacros for Social Media and fake Likes/Follow/Comments/etc never want to share their Script, always thinking they are the best and "Expert SEO", and don't want help the "Competition", ah-ah...! :roll:
Oh I can post a script for protonmail but I think then is the service down. I have wrote it because the site says all is under control "Secure Email Based in Switzerland" but I have no pop3/imap access (export with the Bridge possible for Win/Mac) and I never trusted the site. But never used for spam or shared with other users. Proof of concept, it was too good. It works since years to grab and send my private emails with multiple accounts as my own pop3/imap bridge on my linux servers. :oops:
chivracq wrote:
Mon May 13, 2019 4:59 am
I never help Users for Scripts related to [Games/Votes/Captcha/Forums/Social Media] with 'Like'/'Follow'/'Comment'... 8)
But captchas are not broken, only the humans! :o
Yeah well, I guess you understand @thecoder why I didn't "really" want to help @OP..., who didn't even bother to follow up and to reply... :wink:

Another very strange "Bird" was the @Goldfish_whatever User who posted in this Thread, check their few (later/last) Posts for a good Laugh, ouf-ouf...!!, you are going to "hallucinate", ah-ah...! (While when they first joined the Forum (=> their first Posts/Threads), they sounded like a "nice" and interesting/interested User, but they a bit too quickly "borderlinely" completely changed, ouf-ouf...! :shock: )
- (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...
User avatar
thecoder2012
Posts: 446
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: how do i get imacros to adapt to nth-of-type change?

Post by thecoder2012 » Thu Jul 04, 2019 11:10 am

chivracq wrote:
Thu Jul 04, 2019 10:48 am
Yeah well, I guess you understand @thecoder why I didn't "really" want to help @OP..., who didn't even bother to follow up and to reply... :wink:
Yep I understand it but I hate all big sites (e.g. Instagram). It's too big too fail. :evil:
chivracq wrote:
Thu Jul 04, 2019 10:48 am
.. you are going to "hallucinate", ah-ah...! (While when they first joined the Forum (=> their first Posts/Threads), they sounded like a "nice" and interesting/interested User, but they a bit too quickly "borderlinely" completely changed, ouf-ouf...! :shock: )
:shock: :shock: :shock:
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: how do i get imacros to adapt to nth-of-type change?

Post by chivracq » Thu Jul 04, 2019 11:34 am

thecoder2012 wrote:
Thu Jul 04, 2019 11:10 am
chivracq wrote:
Thu Jul 04, 2019 10:48 am
Yeah well, I guess you understand @thecoder why I didn't "really" want to help @OP..., who didn't even bother to follow up and to reply... :wink:
Yep I understand it but I hate all big sites (e.g. Instagram). It's too big too fail. :evil:
Yeah well, for me it's not a Question of "big" or "too big", I simply don't help for Social Media and especially Commenting and Messaging, same with Forums, this is complete Spam for me... :shock:

thecoder2012 wrote:
Thu Jul 04, 2019 11:10 am
chivracq wrote:
Thu Jul 04, 2019 10:48 am
.. you are going to "hallucinate", ah-ah...! (While when they first joined the Forum (=> their first Posts/Threads), they sounded like a "nice" and interesting/interested User, but they a bit too quickly "borderlinely" completely changed, ouf-ouf...! :shock: )
:shock: :shock: :shock:
Yep, shock-shock, what a complete Weirdo...! And a few other "creative and pretty illustrative" Terms were also used in Reports... (not visible publicly...) 8)
I used to "maintain" some "funny" Thread in which I was keeping track of such funny Threads and Users, I remember one in Spanish and one in Russian, but that was more than 2 years ago, I think... All I remember was that even Google-Translate was blushing, ah-ah...! :wink:
- (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...
User avatar
thecoder2012
Posts: 446
Joined: Sat Aug 15, 2015 5:14 pm
Location: Internet
Contact:

Re: how do i get imacros to adapt to nth-of-type change?

Post by thecoder2012 » Thu Jul 04, 2019 11:49 am

chivracq wrote:
Thu Jul 04, 2019 11:34 am
Yeah well, for me it's not a Question of "big" or "too big", I simply don't help for Social Media and especially Commenting and Messaging, same with Forums, this is complete Spam for me... :shock:
Okay but "big" or "too big" is bad for us. Better sites has no spam with a really good solution but only if it's better than the standard anti-spam things. But humans are only for big websites (up to 99%, not all). :(
chivracq wrote:
Thu Jul 04, 2019 11:34 am
All I remember was that even Google-Translate was blushing, ah-ah...! :wink:
Always Google? No deepl or bing translator? :(
Join 9kw.eu Captcha Service now and let your iMacros continue downloads and scripts while you sleep. - Custom iMacros? Contact me! :idea:
chivracq
Posts: 10301
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: how do i get imacros to adapt to nth-of-type change?

Post by chivracq » Thu Jul 04, 2019 1:25 pm

thecoder2012 wrote:
Thu Jul 04, 2019 11:49 am
chivracq wrote:
Thu Jul 04, 2019 11:34 am
Yeah well, for me it's not a Question of "big" or "too big", I simply don't help for Social Media and especially Commenting and Messaging, same with Forums, this is complete Spam for me... :shock:
Okay but "big" or "too big" is bad for us. Better sites has no spam with a really good solution but only if it's better than the standard anti-spam things. But humans are only for big websites (up to 99%, not all). :(
chivracq wrote:
Thu Jul 04, 2019 11:34 am
All I remember was that even Google-Translate was blushing, ah-ah...! :wink:
Always Google? No deepl or bing translator? :(
Oh, well, about Translators, if I really need to understand stg in some Language I "really" don't speak, then Google-Translate is usually good enough "now" (it used to be quite "exotic" and funny a few years ago, ouaf-ouaf...!)...

But otherwise, Google-Translate can be ueber-hilarious when deliberately "misused", just like I did last night with some Dutch Friend (we "normally" communicate in Dutch (of course!)), but sometimes we chat for the Fun in the most exotic Languages we can find, using deliberately the most colloquial Expressions + Abbreviations and we 2x or 3x translate between 3 or 4 Languages and the "Result" is usually hilarious..., and our "Target-Language" last night was Swedish, because there was some NL-Sweden Football Match last night... :P
No Idea who won, but I didn't hear any big screaming in my street and neighbourhood, so I "suspect" that Sweden probably won, ah-ah...!, and that NL also probably didn't score any single Goal, or they were already 3 or 4 Goals behind if they scored any, re-ah-ah...! (I honesty don't know anything about the Final Result...)
- (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...
Post Reply