Selection from DropDown

Discussions and Tech Support related to the iMacros Google Chrome extension.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.
Post Reply
shamus
Posts: 5
Joined: Thu Jun 30, 2016 8:21 pm

Selection from DropDown

Post by shamus » Sun Jun 24, 2018 12:29 pm

You know what fck this. Got what I wanted from another forum. Much more helpful and less anal and less pendantic. I know why I've not used this forum for 2yrs.
Last edited by shamus on Sun Jun 24, 2018 10:14 pm, edited 8 times in total.
chivracq
Posts: 7890
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Seletion from DropDown

Post by chivracq » Sun Jun 24, 2018 2:58 pm

shamus wrote:Hi Using imacro for Chrome. I'm new to this and the recording does not save the value selection from the drop down. And I don't have much knowlegde of the tags/html etc. Hence using the recorder. Not sure why it doesn't since seems to record other selections.

This is the inspect code from Chrome

Code: Select all

<span id="desc-money">Account: <div class="select2-container" id="s2id_select-bank-acc"><a tabindex="-1" class="select2-choice" onclick="return false;" href="javascript:void(0)">   <span class="select2-chosen">#251618562627 ($8,688)</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" id="s2id_autogen2" type="text"></div><select name="acc" tabindex="-1" class="select2-offscreen" id="select-bank-acc"><option value="251618562627">#251618562627 ($8,688)</option><option value="967756026">#967756026 ($0)</option></select></span>
This is my selection viewed in inspect and I want to select the Value 967756026 form the dropdown

What would be the TAG script to select that?

I've tried, and others, but not really understanding how the TYPE/FORM etc relate to the inspect sript I have

Code: Select all

TAG POS=2 TYPE=SELECT FORM=NAME:acc ATTR=NAME:select-bank-acc CONTENT=$967756026
I've also tried

Code: Select all

TAG POS=2 TYPE=SELECT FORM=NAME:select-bank-acc ATTR=NAME:acc CONTENT="#967756026 ($0)"
Anu help would be greatly appericated.
Same first Reply like in your previous Thread for me to have a look...
=> FCIM...! :mrgreen: (Read my Sig...)
And nice try with "I'm new to this", ah-ah...!, your previous Thread is already from 2 years ago, so "New" doesn't really apply to you anymore, ah-ah...! :wink:

And your Thread has probably nothing specific to 'iMacros for CR', unless your Script works in other Browsers but fails in CR only... (maybe that's the case, then you should mention it...)
=> Try to select the correct Sub-Forum when you open a Thread... (But no need to duplicate now...!)

And you'll need as well to correct the ugly Typo/Spelling Mistake in your Thread Title for me to answer it, nobody is going to search the Forum using "Seletion" as a Search Keyword... :roll:
(Your whole Post is full of Typos btw, quickly irritating to read to be honest, ["Seletion", "imacro", "knowlegde", "form", "sript", "Anu", "appericated" (ouf-ouf, this one "hurts"...! :shock: )], I hope you put a little bit more "Effort" in your Scripts, Runtime Engines will only respond with "Syntax Error", ah-ah...! :idea: )
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
shamus
Posts: 5
Joined: Thu Jun 30, 2016 8:21 pm

Re: Selection from DropDown

Post by shamus » Sun Jun 24, 2018 7:04 pm

Apologies, wrote in a rush and on my phone. Lesson learnt. Don't, use computer instead. Well I would consider 2 years quite along time between posts. So still new.... :D - I've made the correction, does that work better?
chivracq
Posts: 7890
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Selection from DropDown

Post by chivracq » Sun Jun 24, 2018 8:26 pm

shamus wrote:Hi Using imacro for Chrome. The recording does not save the value selection from the drop down. And I don't have much knowledge of the tags/html etc. Hence using the recorder. Not sure why it doesn't since seems to record other selections.

Code: Select all

Chrome: Chrome64_51.0.2704.84
iMacro: 8.9.7 Extension
OS: Win 10
This is the inspect code from Chrome

Code: Select all

<span id="desc-money">Account: <div class="select2-container" id="s2id_select-bank-acc"><a tabindex="-1" class="select2-choice" onclick="return false;" href="javascript:void(0)">   <span class="select2-chosen">#251618562627 ($8,688)</span><abbr class="select2-search-choice-close"></abbr>   <span class="select2-arrow"><b></b></span></a><input class="select2-focusser select2-offscreen" id="s2id_autogen2" type="text"></div><select name="acc" tabindex="-1" class="select2-offscreen" id="select-bank-acc"><option value="251618562627">#251618562627 ($8,688)</option><option value="967756026">#967756026 ($0)</option></select></span>
This is my selection viewed in the 'inspect' found in Chrome and I want to select the Value 967756026 from the dropdown

What would be the TAG script to select that?

I've tried, and others, but not really understanding how the TYPE/FORM etc relate to the script I have

Code: Select all

TAG POS=2 TYPE=SELECT FORM=NAME:acc ATTR=NAME:select-bank-acc CONTENT=$967756026
I've also tried

Code: Select all

TAG POS=2 TYPE=SELECT FORM=NAME:select-bank-acc ATTR=NAME:acc CONTENT="#967756026 ($0)"
Any help would be greatly appreciated.
shamus wrote:Apologies, wrote in a rush and on my phone. Lesson learnt. Don't, use computer instead. Well I would consider 2 years quite along time between posts. So still new.... :D - I've made the correction, does that work better?
Oh...!, that's much better indeed...! :D
Hum..., even if you still can get to spell "iMacros" correctly (x2), but OK, good enough...! :wink:

And FCI mentioned, perfect..., except that, grumpf-grumpf-arrgghhh...!, no "Syntax Error" this time, but a "Compiler Error", you'll have to explain to me how you managed to install 'iMacros for FF v8.9.7' on 'Google Chrome'...!? :?
'iMacros v8.9.7' is a Version of the Add-on for FF, and not for CR...!

UNLESS...!, and that would be a very good News...!!, (I'm serious!), it is now possible (on CR64+) to install FF Add-ons...? :twisted:
If that's the case indeed, I didn't know, and you are the first to post such a "Cross-Browser Config", and that would be a very-very good News indeed...! And even "Pre-Web-Extensions" Add-ons, oh-oh...!, excellent...!!

But OK, if you made a "Mistake", I'm still waiting for your "real" Version (or a Confirmation that you are indeed really using v8.9.7 for FF on CR64), "standard" Versions for CR64 would be 'v8.4.4 for CR' or 'v10.0.2 for CR' (or I think some 'v10.0.3 for CR' got released recently... (I don't use CR, so I don't really follow it...))
Hum, and if using v10.0.x for CR, you need to mention now if you use the 'Free' or the 'PE' Version ('PE' = 'Personal Edition' (with File Access and all Commands enabled...)).

EDIT: Oh no...!, 'v10.0.1 for CR' was the "standard" v10 Version for CR for several months, and v10.0.2 got released recently... and a bit "silently", without any Official Announcement... (And there is no 'v10.0.3 for CR' (yet...!).) (Got a bit mixed up because FF now has a 'v10.0.2 Beta' Version since 1 or 2 weeks...)
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
shamus
Posts: 5
Joined: Thu Jun 30, 2016 8:21 pm

Re: Selection from DropDown

Post by shamus » Sun Jun 24, 2018 9:41 pm

....
chivracq
Posts: 7890
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Selection from DropDown

Post by chivracq » Sun Jun 24, 2018 11:09 pm

shamus wrote:Correction....
OK, was 'v10.0.2 for CR' then...

Oh, but ah-ah...!, I see you've completely mutilated your Posts, oh well...! Sounds a bit childish to me, ah-ah...! Never mind... :shock:
shamus wrote:You know what fck this. Got what I wanted from another forum. Much more helpful and less anal and less pendantic. I know why I've not used this forum for 2yrs.
Yeah, well..., sorry for you if you cannot put 1 min "Effort" in your Posts/Threads to mention 3 Versions and cannot type 3 Words in a row without a Typo, you would have gotten your Answer directly after your OP... :roll:

>>>

Hum..., OK..., still posting "my Solution" for other Users searching the Forum who might be interested... (I was already halfway through typing it anyway....) :wink:

I think this one would have worked...:

Code: Select all

TAG POS=1 TYPE=SELECT ATTR=ID:select-bank-acc CONTENT=%967756026
Explanation...:
From the Source:

Code: Select all

<select name="acc" tabindex="-1" class="select2-offscreen" id="select-bank-acc"><option value="251618562627">#251618562627 ($8,688)</option><option value="967756026">#967756026 ($0)</option></select>
- There is no Info included about the Form Name, it will be defined at some higher Level than the 'SPAN' @OP posted the Source of... Could be identified by tagging anything anywhere "in the Area" that gets recorded, but is probably not needed anyway..., unless there are several Forms on the Page with all a same 'select-bank-acc' DDLB.

- "select-bank-acc" is the 'ID' of the DDLB => "ATTR=ID:select-bank-acc", but "ATTR=NAME:acc" should work as well, I prefer the ID because "acc" is very short and there could be more Elements on the Page with the same Name.

- And then selecting the Option...! "967756026" is the "Value" Attribute, and needs to be specified with the '%' Symbol (and not '$' like @OP had tried which is for Names, although "CONTENT=$#967756026<SP>($0)" should/could/might have worked as well, but I'm afraid that iMacros might get confused by the '#' at the beginning of the Name as iMacros uses this Symbol to select by Index.).
Everything is explained in the Wiki, of course...

- And the 'POS=1' might need to be adjusted to the correct POS Nb, depending on the Page..., no idea why @OP had used "POS=2" if nothing was recorded by iMacros...

Some Solution/Workaround to avoid the "Uncertainty" around the 'FORM' and 'POS' Parameters, if there are several similar Elements on the Page, would be using "Double Relative Positioning" on the "desc-money" 'SPAN' as Anchor with its 'ID', maybe combined with its Name ("Account: ") but the Name only might be "dangerous" because it contains a trailing Space which would need an "<SP" or a "*" (Wildcard), but some Versions of iMacros automatically trim the trailing Space and putting a Wildcard at the end of the Name might find other "Account: xxx" Elements...

And when nothing gets recorded by the 'TAG' Mode, I guess the 'EVENT' Mode would still have worked...

EDIT:
Hum..., selecting the Option by Name wouldn't really work I think, because of the "($0)" part which is probably the Amount on this Account and that will probably change..., but I think iMacros "doesn't really like" using Wildcards inside DDLB Option Names... (even if the Wiki mentions that Wildcards can be used, I think I've already tried "previously" for some other Thread and it was not working completely as "expected"...).
=> The one I posted with the Value is probably the most reliable...
Select by Index (with "#2" I guess) could work as well, unless the Nb of Options or their Order is dynamic, then it's not reliable...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
Posts: 7890
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Selection from DropDown

Post by chivracq » Thu Jun 28, 2018 1:39 pm

Hum, 4 days later..., I tried to locate @OP's parallel Thread on this "non-anal-ytic" and "inde-pe[n]dant-ic" friendly Forum but I never found it... :oops:

Not on SOF anyway (Stackoverflow) nor any other Technical Forum I know of with some iMacros "Expertise"... and 'Google' nor 'Bing' didn't find it...

I guess I would have been interested to see what Solution they provided on that Forum and if it corresponded a bit with my "Anal[ysis]" and "my" Solution..., but I guess we'll never know, ah-ah...! OK, never mind... :wink:
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
Post Reply