How to open a new tab in experimental mode?

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
Deeper
Posts: 3
Joined: Wed Nov 04, 2020 8:41 am

How to open a new tab in experimental mode?

Post by Deeper » Wed Nov 04, 2020 9:02 am

Hello.
I have a such code:

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://expample.com

TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(1)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
...
TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(10)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
Code doesn't work. I'd like to open each link one by one in new TAB 2, close it and then open next one in TAB 2. Only DIV:nth-of-type(x) changes from 1 to 10. I prefer experimental mode. Can anyone help?

(Windows 8.1, Firefox 55.0 (32 bits), iMacros 9.0.3)
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to open a new tab in experimental mode?

Post by chivracq » Wed Nov 04, 2020 10:32 pm

Deeper wrote:
Wed Nov 04, 2020 9:02 am
Hello.
I have a such code:

Code: Select all

VERSION BUILD=9030808 RECORDER=FX
TAB T=1
URL GOTO=https://expample.com

TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(1)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(3)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
...
TAB OPEN
TAB T=2
EVENT TYPE=CLICK SELECTOR="HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(10)>DIV>DIV>A>IMG" BUTTON=2
TAB CLOSE
Code doesn't work. I'd like to open each link one by one in new TAB 2, close it and then open next one in TAB 2. Only DIV:nth-of-type(x) changes from 1 to 10. I prefer experimental mode. Can anyone help?

Code: Select all

(Windows 8.1, Firefox 55.0 (32 bits), iMacros 9.0.3)

Oh...!?, good...! You've just added your FCI, excellent, I won't have to ask you... :D
(Silently editing your Post/OP is btw always a bit "dangerous", I usually see new Posts "very quickly", and this one for sure as I had to approve it, but I may not notice straightaway some later "silent Edit"... You can better post some mini-Update that you've added some Info... :idea: )

Only pay attention next time you open a Thread to select the "correct" Sub-Forum, the 'EVENT' Mode is not specific to the 'iMacros for FF' Sub-Forum (anymore)... (It used to be, the 'EVENT' Mode was for several years only implemented/supported in iMacros for FF (from v8.24 - v9.0.3), "now" it's not even supported in the "current" v10.0.2 for FF Version...)
... And I don't react/help when Threads are opened in the "wrong" Sub-Forum..., or at least until they've been moved to the "correct" one, which usually takes a few days, as I cannot do it myself, and I/we each time need to ask the Forum Admin to do so, which is a bit of "a waste of time" for everybody... :idea:

v9.0.3 for FF is btw a bit of a "strange' Version to use, it is Buggy and Limited, compared to the "much better" v8.9.7 for FF Version, which also works on FF55, => FF v55.0.3 is the Version I use myself... Just saying...! :idea:

>>>

Hum, OK, concerning your Qt/Scenario, I don't understand "everything"... Well "(Code) doesn't work." is always a bit vague on a Tech Forum if you don't explain what is not working...
And from "https://expample.com" on 'TAB_1' supposed to open some Links in a new Tab, we don't get much "wiser", ah-ah...!

You then do some 'TAB OPEN' before switching to that/those Tab(s), but it/they will be "empty" if you don't do any 'URL GOTO' in it/them before you can fire any following 'TAG' or 'EVENT' Commands...
=> You need to extract the Link URL from 'TAB_1' to reuse on your newly opened 'TAB_2(+)' with 'URL GOTO'...

Or from 'TAB_1', you can probably "directly" open those Links in a new Tab with a Middle Click on the Link (=> with 'BUTTON=1' and not 'BUTTON=2' like you have in your Script), or with a 'Ctrl^L-Click' => 'BUTTON=0' for the Left-Click + 'Modifiers=Ctrl' for the 'Ctrl' part... :idea:

And use a Var if you want to loop or more "easily" hard-copy Blocks of the same Code for the [1-10] in "DIV:nth-of-type(n)"... :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...
Deeper
Posts: 3
Joined: Wed Nov 04, 2020 8:41 am

Re: How to open a new tab in experimental mode?

Post by Deeper » Wed Nov 04, 2020 11:16 pm

Hello. Thank you for reply.
You then do some 'TAB OPEN' before switching to that/those Tab(s), but it/they will be "empty" if you don't do any 'URL GOTO' in it/them before you can fire any following 'TAG' or 'EVENT' Commands...
=> You need to extract the Link URL from 'TAB_1' to reuse on your newly opened 'TAB_2(+)' with 'URL GOTO'...
Okay. You are right. This part of my code doesn't work properly. I need to extract the Link URL from 'TAB_1' to reuse it on my newly opened 'TAB_2(+)' with 'URL GOTO'. But the links don't look typically like http://something.com/ How can I write it correctly? I wasted several hours to do that, but without any success... I got an error saying:
Can not locate element specified by selector "HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(1)>DIV>DIV>A>IMG", line: 5 (Error code: -921)
And use a Var if you want to loop or more "easily" hard-copy Blocks of the same Code for the [1-10] in "DIV:nth-of-type(n)"... :idea:
Okay. This part of my code works, but is there any other way to write it (as you mentioned before) more "easily" using VAR?

Any ideas for both of my problems?

And BTW. I've just installed ver. 8.9.7. I feel much safer :wink:
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to open a new tab in experimental mode?

Post by chivracq » Thu Nov 05, 2020 12:07 am

Deeper wrote:
Wed Nov 04, 2020 11:16 pm
Hello. Thank you for reply.
You then do some 'TAB OPEN' before switching to that/those Tab(s), but it/they will be "empty" if you don't do any 'URL GOTO' in it/them before you can fire any following 'TAG' or 'EVENT' Commands...
=> You need to extract the Link URL from 'TAB_1' to reuse on your newly opened 'TAB_2(+)' with 'URL GOTO'...
Okay. You are right. This part of my code doesn't work properly. I need to extract the Link URL from 'TAB_1' to reuse it on my newly opened 'TAB_2(+)' with 'URL GOTO'. But the links don't look typically like http://something.com/ How can I write it correctly? I wasted several hours to do that, but without any success... I got an error saying:
Can not locate element specified by selector "HTML>BODY>DIV:nth-of-type(4)>DIV:nth-of-type(2)>DIV:nth-of-type(2)>DIV:nth-of-type(1)>DIV>DIV>A>IMG", line: 5 (Error code: -921)

"Okay. You are right."
=> Yeah-yeah, don't worry, I'm ALWAYS right, ah-ah...! (Well..., in 99% of the Cases, ah-ah...!) :shock: :P :twisted: :wink:

OK, more seriously, pfff..., I don't "know"..., URL/Site not posted, => I only give "Generic" Advice... :|
If your Site needs to be kept "so secret", I already gave you all Info...

=> To extract the URL of your Links from 'TAB_1', you need to use the 'TAG' Mode with the 'EXTRACT' Mechanism, that's the "Way to go", either with 'EXTRACT=HREF' or with 'EXTRACT=HTM' on "some" Element or the whole Source, and then + 'EVAL()' to isolate the Data that you want to keep, but 'EXTRACT=HREF' should "do the Job" already, I don't know what you mean by "But the links don't look typically like http://something.com/"... Hum, well, I do probably..., but I won't go into some endless if/if/if Scenario/Explanation... :roll:

I actually do have a Technique to implement the 'EXTRACT' Mechanism/Func to the 'EVENT' Mode, but I've never posted it (yet), and I definitely won't post it in this Thread about some "secret Site", sorry but when I post "Creative" Solutions, it's to help the whole Community, not just one User who wants "to beat the Competition"... :|

The easiest Way in your Case anyway would be the 'Ctrl^CLICK' using the 'EVENT' Mode, I would think... :idea:

>>>
Deeper wrote:
Wed Nov 04, 2020 11:16 pm
And use a Var if you want to loop or more "easily" hard-copy Blocks of the same Code for the [1-10] in "DIV:nth-of-type(n)"... :idea:
Okay. This part of my code works, but is there any other way to write it (as you mentioned before) more "easily" using VAR?

Any ideas for both of my problems?

Yep, I've said everything already, several other Threads on the Forum about that Func, search a bit, and/or try to implement it yourself... It's fairly easy..., nothing very "complicated"... :idea:

>>>

EDIT:
Deeper wrote:
Wed Nov 04, 2020 11:16 pm
And BTW. I've just installed ver. 8.9.7. I feel much safer :wink:

OK, seen your Edit... Good-good...! :D

v9.0.3 for FF was a bit of a "useless" Version anyway, pretty Buggy, unless you used only the "very Standard'" Functionality/Commands, for some "easy" Click-Click-Click... v8.9.7 is muuuuch better, ah-ah...! 8)

That Version btw also works on PM28/Basilisk2020/Waterfox2020, if you ever need a Browser forked on FF that didn't adopt the 'WebExtensions' Architecture and that still gets maintained, for 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...
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to open a new tab in experimental mode?

Post by chivracq » Thu Nov 05, 2020 12:06 pm

Hum..., and perfectly fine to open parallel Threads on different Tech Forums, but you "need" to provide the same Quality on all Forums, => can you also include your FCI in your Thread/Qt on SOF...? (Or you'll get a '-1' on that Qt from me, ah-ah...! :( )
- Extract url and open it in a new tab in iMacros?
(No Replies/Answer(s) yet...)

Hum, and if you delete that Thread/Qt on SOF, then I stop helping at all...! Just saying... :idea:
(... Like "happened" with this User/this Thread for example...)

>>>

Hum, and I wanted to add "stg" about "stg" I mentioned earlier in some previous Post (about extracting the Links), but "now" I'll wait until you've added your FCI to your Thread on SOF... :|
- (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...
Deeper
Posts: 3
Joined: Wed Nov 04, 2020 8:41 am

Re: How to open a new tab in experimental mode?

Post by Deeper » Thu Nov 05, 2020 8:28 pm

chivracq, you don't help much... Pity. Can anyone help me to solve this problem?
chivracq
Posts: 9721
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: How to open a new tab in experimental mode?

Post by chivracq » Thu Nov 05, 2020 8:36 pm

Deeper wrote:
Thu Nov 05, 2020 8:28 pm
chivracq, you don't help much... Pity. Can anyone help me to solve this problem?

OK, I'm "out" then..., and "good Luck" with other (Advanced) Users, but I already gave you several Solutions anyway, I can't "help you'" indeed, if you don't want to (try to) implement (at least one of) them... :o

>>>

Oh!, hum..., and still being "nice", the one thing I wanted to mention earlier..., is that the 'EXTRACT=HREF' Solution I had mentioned in my first Reply I think, will probably not work "directly", well..., depending on which Element you would fire it, but from the scarce Info you've provided about this Site/Page (on 'TAB_1') and its HTML Structure, I guess you will probably use the 'IMG' Element, but 'EXTRACT=HREF' will then return the 'HREF' of the Image itself, and not the Link (that you want), because from the 'XPATH'/'PATH' I can see in your 'EVENT' Statements, the Link is actually at 1 Level above in the CSS Hierarchy, so you would need to take that "into account" to get the Func that you want in the end...

But I guess you probably won't really understand what I mean, it's always "a bit difficult" to explain "Things" in some Generic Way, without being able to use a concrete Example..., that you don't want to provide, then OK, fair enough..., but I don't think anybody will be able to help you more than I did... :(
- (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...
Post Reply