How to loop Css clicks and click subsequent CSS
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
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
How to loop Css clicks and click subsequent CSS
Config: Windows 10 64 bit, IMacro Enterprise v11.5.499_3066, Imacro Browser,
http://forum.imacros.net/search.php
Essentially I want to click [All Results] and then once that’s done.. I then want to click the nav tabs (that open once I’ve clicked [ALL RESULTS]. Lets say once I click [All Results] it had 1400 different buttons I wanted to click, it doesn’t but lets say it did. How would I go about looping this?
The Css after the [ALL RESULTS] is…
#st > option:nth-child(1)
#st > option:nth-child(3)
#st > option:nth-child(1)
I have thus far…
VERSION BUILD=11.5.499.3066
TAB T=1
TAB CLOSEALLOTHERS
SET !PLAYBACKDELAY 0.2
URL GOTO=http://forum.imacros.net/search.php
TAG SELECTOR="#st" CONTENT=%1
TAG POS=((!LOOP)) TYPE=SELECT ATTR=CLASS* EXTRACT=TXT <- Is there a way to do this for CSS like increasing in a variable or somehow not having to type the exact CSS name and all for each of them? As I want it to continually loop click TAG SELECTOR="#st" CONTENT=%1 and then click subsequent CSS. Thanks in advance, I appreciate it.
http://forum.imacros.net/search.php
Essentially I want to click [All Results] and then once that’s done.. I then want to click the nav tabs (that open once I’ve clicked [ALL RESULTS]. Lets say once I click [All Results] it had 1400 different buttons I wanted to click, it doesn’t but lets say it did. How would I go about looping this?
The Css after the [ALL RESULTS] is…
#st > option:nth-child(1)
#st > option:nth-child(3)
#st > option:nth-child(1)
I have thus far…
VERSION BUILD=11.5.499.3066
TAB T=1
TAB CLOSEALLOTHERS
SET !PLAYBACKDELAY 0.2
URL GOTO=http://forum.imacros.net/search.php
TAG SELECTOR="#st" CONTENT=%1
TAG POS=((!LOOP)) TYPE=SELECT ATTR=CLASS* EXTRACT=TXT <- Is there a way to do this for CSS like increasing in a variable or somehow not having to type the exact CSS name and all for each of them? As I want it to continually loop click TAG SELECTOR="#st" CONTENT=%1 and then click subsequent CSS. Thanks in advance, I appreciate it.
Re: How to loop Css clicks and click subsequent CSS
Hum..., you could add a Question Mark to your Thread Title, I thought you were sharing a HowTo/Tutorial...Wheatlyos wrote:Config:Code: Select all
Windows 10 64 bit, IMacro Enterprise v11.5.499_3066, Imacro Browser,
Essentially I want to click [All Results] and then once that’s done.. I then want to click the nav tabs (that open once I’ve clicked [ALL RESULTS]. Lets say once I click [All Results] it had 1400 different buttons I wanted to click, it doesn’t but lets say it did. How would I go about looping this?Code: Select all
http://forum.imacros.net/search.php
The Css after the [ALL RESULTS] is…I have thus far…Code: Select all
#st > option:nth-child(1) #st > option:nth-child(3) #st > option:nth-child(1)
<- Is there a way to do this for CSS like increasing in a variable or somehow not having to type the exact CSS name and all for each of them? As I want it to continually loop click TAG SELECTOR="#st" CONTENT=%1 and then click subsequent CSS. Thanks in advance, I appreciate it.Code: Select all
VERSION BUILD=11.5.499.3066 TAB T=1 TAB CLOSEALLOTHERS SET !PLAYBACKDELAY 0.2 URL GOTO=http://forum.imacros.net/search.php TAG SELECTOR="#st" CONTENT=%1 TAG POS=((!LOOP)) TYPE=SELECT ATTR=CLASS* EXTRACT=TXT

Well, I don't "have" this 'TAG SELECTOR' Mode which I thought was only implemented in iMacros v8.4.4 for CR, but in iMB v11.5 as well, looks from your FCI, and I only/mostly use iMacros for FF (v8.8.2 and v8.9.7) where this Mode has not been implemented (yet...!?) but I reckon it works a bit like the 'EVENT' Mode with 'SELECTOR', then I would think you can use a Var for the 'n' part in the ':nth-of-type(n)' part of the Selector like:
Code: Select all
TAG SELECTOR="#st:nth-of-type({{!LOOP}})" CONTENT=%1
(It works for the 'EVENT' Mode and I use this "Technique" myself, I would expect it to work as well for the 'TAG SELECTOR' Mode...)
(But this is a "bad" Example on your Example Page as there is only one '#st' Element, the 2nd DDLB (for 'Post Time', 'Author' etc...) is called '#sk', etc...)
But if you want to loop through the different Options in the DDLB, then you can use a Var in the 'CONTENT' part like:
Code: Select all
TAG SELECTOR="#st" CONTENT=%{{!LOOP}}
Not sure I exactly understood your Qt though, ah-ah...! (I can't really place the "1400 different buttons" part in your Scenario, at least on this 'Search' Page...) Can you give otherwise more Details about what exactly you want...?
Hum..., and if your "Goal" is to extract all the Options in the DDLB, you can simply use the 'EXTRACT=TXTALL' Built-in Mechanism... (as opposed to 'EXTRACT=TXT' which will extract the currently selected (= visible) Option in the DDLB...)
- (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...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Re: How to loop Css clicks and click subsequent CSS
Why chivracq, according to this http://wiki.imacros.net/TAG Firefox plugin has selector mode implemented:chivracq wrote: Well, I don't "have" this 'TAG SELECTOR' Mode which I thought was only implemented in iMacros v8.4.4 for CR, but in iMB v11.5 as well, looks from your FCI, and I only/mostly use iMacros for FF (v8.8.2 and v8.9.7) where this Mode has not been implemented (yet...!?)
Code: Select all
TAG SELECTOR="[selector_expression]" [CONTENT=some_content]
Re: How to loop Css clicks and click subsequent CSS
Ah-han...!, oh...!, then it's possible that it's maybe implemented in v9.0.3 for FF which I never installed/tested, I only checked/tested in v8.9.7 for FF (+ v8.8.2 for FF which is my "Prod" Environment, but I knew it wouldn't be present in this Version)...serbeer wrote:Why chivracq, according to this http://wiki.imacros.net/TAG Firefox plugin has selector mode implemented:chivracq wrote: Well, I don't "have" this 'TAG SELECTOR' Mode which I thought was only implemented in iMacros v8.4.4 for CR, but in iMB v11.5 as well, looks from your FCI, and I only/mostly use iMacros for FF (v8.8.2 and v8.9.7) where this Mode has not been implemented (yet...!?)Now, I myself I only use POS and XPATH modes so far I must admit, and they always did the trick for me, but I always thougth that would have SELECTOR mode available as well if ever becomes needed, so was surprised by your reply.Code: Select all
TAG SELECTOR="[selector_expression]" [CONTENT=some_content]
Oh yeah...!, and when I had typed my previous Reply, I had checked the Wiki and the Release Notes for v9.0.3 for FF don't mention anything about this Mode, while it is neatly documented in the Released Notes for v8.4.4 for CR...:
Version History (iMacros for FF)
2016-08-10 V9.0.3 => Download now
This version is a major upgrade to add compatibility with Multi Process Firefox released in Firefox 48 (codename Electrolysis, e10s). Unfortunately, this change imposes the following limitations:
SCREENSHOT TYPE=BROWSER is no longer possible,
SAVEAS TYPE=CPL is not available anymore,
File Upload in the TAG command cannot be supported.
CLICK (X/Y) record mode is now deprecated, use EVENT mode instead. However, existing macros that contain CLICK commands can be replayed.
The following were never officially supported and had to be removed as well, since Firefox no longer allows access to the page DOM from the browser context (only frame scripts can do so now)
No access to webpage DOM from javascript in .js files (window, content objects) or macros (URL GOTO=javascript:...),
imns (iMacros namespace) is no longer accessible.
But hum..., pity @OP never followed up on this Thread, that was an interesting "Case", ah-ah...!Version History (iMacros for CR)
2016-06-20 V8.4.4 Download now
Added: new recording mode EVENT
Added: TAG SELECTOR command, to localize element using CSS selectors
Several bug fixes
- (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...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
Re: How to loop Css clicks and click subsequent CSS
Hi, sorry for the late reply. Your solution worked so thanks heaps. I haven't really been able to dig into Imacro as much as I would have liked. I am impressed though. I can see there is a bit of a steep learning curve and a lot of potential. For me I feel like it would only take a matter of months before I have mastered some of the more basic functions and that is actually really awesome. I understand this query is resolved, but one query I do have is how does one utilise this for more than one website? So lets say I wanted to use the above example in two webpages. How would you go about that?
Re: How to loop Css clicks and click subsequent CSS
Oh..., good, nice to see you back...!Wheatlyos wrote:Hi, sorry for the late reply. Your solution worked so thanks heaps. I haven't really been able to dig into Imacro as much as I would have liked. I am impressed though. I can see there is a bit of a steep learning curve and a lot of potential. For me I feel like it would only take a matter of months before I have mastered some of the more basic functions and that is actually really awesome. I understand this query is resolved, but one query I do have is how does one utilise this for more than one website? So lets say I wanted to use the above example in two webpages. How would you go about that?

And glad to hear that "my Solution" worked, ah-ah...!


And further about what you consider the 'steep learning curve" for iMacros, I don't really agree to be honest, iMacros has a very intuitive way to use it, you don't need to be a Programmer, you just record your Actions on some Site, you replay, oops...!, not completely OK, you look at the recorded Code, make some little Edits thanks to the nearly perfect Wiki, and that's it...! It's a very easy Programming-Language, very Intuitive..., too easy and too intuitive actually, too many Kids use it, ah-ah...! It took me 30 min 10 years ago when I discovered it during some Game/Competition I was playing to make my perfect Script and win the big Price and 10 years later my old Script still works perfectly and I still win every year, oops...!
The only Quality you need with iMacros is to be a little bit Creative... (and to read the Wiki of course to know what Commands are available and how they work)...
- (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...
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...