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
how do i get imacros to adapt to nth-of-type change?
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
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
-
- Posts: 15
- Joined: Sun Jun 19, 2016 12:10 am
Re: how do i get imacros to adapt to nth-of-type change?
To be honest I don't think stuff like this is possible. I've tried extensively.PBNSurprise wrote: 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
Re: how do i get imacros to adapt to nth-of-type change?
CIM...!PBNSurprise wrote:I have a script running that posts comments on the same picture over and over on Instagram. Here is the script:
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.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
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
CIM...!Rons wrote:To be honest I don't think stuff like this is possible. I've tried extensively.PBNSurprise wrote: 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
Yep, it is possible, I've already explained the Principle a few times...
- (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...
- FCI not mentioned: I don't even read the Qt...! (or only to catch Spam!)
- Script & URL help a lot for more "educated" Help...
Re: how do i get imacros to adapt to nth-of-type change?
Maybe you need something like thisPBNSurprise wrote:>DIV:nth-of-type(3)> suddenly turns into >DIV:nth-of-type(2)>
Code: Select all
>DIV:last-of-type>
-
- Posts: 15
- Joined: Sun Jun 19, 2016 12:10 am
Re: how do i get imacros to adapt to nth-of-type change?
i can't remember how i solved this.. i think the way i did it was setting two different numbers or variables to equal nth-of-type that i needed. then i would use both those variables at once. so when the imacros runs it will try both and pick whichever one that worked, if that makes sense