find the closest tag that matches a wildcard

Discussions and Tech Support related to automating the iMacros Browser or Internet Explorer from any scripting and programming language, such as VBS (WSH), VBA, VB, Perl, Delphi, C# or C++.

Moderators: Community Moderators, iMacros Moderators

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.

find the closest tag that matches a wildcard

by estherH on Tue Feb 21, 2017 1:31 pm

Hi,

I am trying to write a script that reads some data from the database, then fills out an online form. So far so good.
But I hit a snag...
On the form, there is a plus button to add a new section. If my data contains certain variables, I need to click the plus button - this brings up an identical section with more fields to fill in - the only difference is the name of the inputs. And this is where the trouble begins.
In the original section, the first field would have name of "field1_111", second would be "field2_222", etc.
But in the copied section, the same field will have a random number tacked on the end, like "field1_24237456356", "field2_6734234243", etc.
And if I make a third copy, the fields will have different random numbers.

Which means, I have no way of knowing in advance what the names of the fields will end up being. I understand I can use a wildcard to match the field name, but my question is, I want to fill in now only the first field that matches based on my current position. meaning, in my macro, i just filled out section 1, and the next tag is the copied section first field, i want it to understand to only fill out that field, and not all the fields that will match the wildcard. hope that made sense.

what can i do? thanks.
estherH
 
Posts: 3
Joined: Tue Feb 21, 2017 1:16 pm

Re: find the closest tag that matches a wildcard

by chivracq on Tue Feb 21, 2017 5:17 pm

estherH wrote:Hi,

I am trying to write a script that reads some data from the database, then fills out an online form. So far so good.
But I hit a snag...
On the form, there is a plus button to add a new section. If my data contains certain variables, I need to click the plus button - this brings up an identical section with more fields to fill in - the only difference is the name of the inputs. And this is where the trouble begins.
In the original section, the first field would have name of "field1_111", second would be "field2_222", etc.
But in the copied section, the same field will have a random number tacked on the end, like "field1_24237456356", "field2_6734234243", etc.
And if I make a third copy, the fields will have different random numbers.

Which means, I have no way of knowing in advance what the names of the fields will end up being. I understand I can use a wildcard to match the field name, but my question is, I want to fill in now only the first field that matches based on my current position. meaning, in my macro, i just filled out section 1, and the next tag is the copied section first field, i want it to understand to only fill out that field, and not all the fields that will match the wildcard. hope that made sense.

what can i do? thanks.

Grrr..., try to use the correct Sub-Forum when you open a Thread, it's a hassle to move them, I don't think from your Thread Title that you are using the Scripting Interface or the Command Line..., hum, I see the Word "DataBase" somewhere in your Post..., what "DataBase" then..., and what Scripting Language...?
(But OK, no need to duplicate...)

CIM...! :mrgreen: (... for me to read, read my Sig...)
- (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: 6373
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: find the closest tag that matches a wildcard

by estherH on Tue Feb 21, 2017 10:33 pm

ok, wasn't sure which forum it belonged in, didn't seem to match any.
using php to put the macro string together, getting info from mysql db, and then using javascript to actually open a browser (firefox) and init/play the macro.
not sure it matters though. the problem would appear to be cross-platform...

how can you get a wildcard to match only the NEXT occurrence based on the last filled tag?

THANKS!
estherH
 
Posts: 3
Joined: Tue Feb 21, 2017 1:16 pm

Re: find the closest tag that matches a wildcard

by chivracq on Tue Feb 21, 2017 11:36 pm

estherH wrote:ok, wasn't sure which forum it belonged in, didn't seem to match any.
using php to put the macro string together, getting info from mysql db, and then using javascript to actually open a browser (firefox) and init/play the macro.
not sure it matters though. the problem would appear to be cross-platform...

how can you get a wildcard to match only the NEXT occurrence based on the last filled tag?

THANKS!

When in doubt, always use the 'General' Sub-Forum, from your Title Thread, the only a bit useful Terms to understand what your Pb might be are "TAG + Wildcard" and those 2 Terms have nothing to do with the Scripting Interface, unless you already have a working Script in pure '.iim' or '.js' that is not working in VBS or whatever Scripting Language you would be using... But OK, never mind, remember that for a next time...

Hum..., don't really understand what you mean with "using php to put the macro string together, getting info from mysql db, and then using javascript to actually open a browser (firefox) and init/play the macro."...
=> Post your Script and what you are doing or trying to do, I still don't see any Info about your Config with Versions, I still haven't read your first Post, sorry... => "not sure it matters though"... => Ah-ah...!, sorry no Config mentioned, I don't read, oops...!, call me a Moron...! :roll:
(Well, I read your 2nd Post..., hum..., until the "How can you get whatever...?", ah-ah...!, even if I think I already have the Answer only from that Line, but use the Forum a bit correctly, sorry, I only help Users using the Forum "a bit correctly" and mentioning your FCI is one of my Criteria + Script and what you've tried... :idea: )

(2nd time I ask about your FCI, I won't react anymore if you don't comply... Consider reading the Forum Rules for Required Tech Info to include when you open a Thread, this is a Technical Forum..., and if you are using php + mysql + javascript, you don't sound like a Script-Kiddie trying to get a few Thousands Likes on FB, so you should understand what "Technical (Forum)" means, I would think... (And I was nice to react with my first Reply, I normally let such Threads rot when Users could not get bothered to read the Forum Rules... And ignore my 2 Replies if you get offended, maybe sbd else will try to help you...))
- (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: 6373
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)

Re: find the closest tag that matches a wildcard

by estherH on Wed Feb 22, 2017 4:13 am

I got the answer, there is a relative positioning tag which does exactly what i want.
POS=R1
estherH
 
Posts: 3
Joined: Tue Feb 21, 2017 1:16 pm

Re: find the closest tag that matches a wildcard

by chivracq on Wed Feb 22, 2017 10:16 am

estherH wrote:I got the answer, there is a relative positioning tag which does exactly what i want.
POS=R1

Ah-ah...!, very good, I'm nearly impressed, that was indeed as well the "Answer" I had from that one Line in your second Post..., which then has nothing to do with "database + php + mysql + javascript", this is "pure" iMacros...

But OK, good that you found the Solution by yourself, but you didn't really understand my "call" to use the Forum "a bit correctly" with "FCI" etc..., but never mind... 8)
- (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: 6373
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Scripting and Command Line Interface

Who is online

Users browsing this forum: No registered users and 3 guests

-->