Page 1 of 1

regular expression to select an input field?

Posted: Sun Jun 14, 2009 2:41 am
by tata668
I'm new to iMacros and find it really well done!

I have a basic question though: Is it possible to use a regular expression to select an input field?

Let's say I use a TAG command, can I use a regex after the ATTR part? I'd like iMacros to be able to fill any fields containing "email", for example. The name (or id) of that field could be "email", "user_email", "emailadress", etc.

I'd like to automate the process of filling forms on different websites, and those don't have the same names for the inputs to fill.


Thanks for the help!

Re: regular expression to select an input field?

Posted: Sun Jun 14, 2009 2:55 am
by tata668
I found that: http://forum.imacros.net/viewtopic.php?f=15&t=2514 : you can use "*" and "ERRORIGNORE" with multiple choices..

Regular expressions would be really appreciated though!

Thanks!

Re: regular expression to select an input field?

Posted: Mon Jun 15, 2009 10:34 am
by Marcia, Tech Support
Hello,

Thank you for your appreciation and suggestion.

I will add the Regular Expression to iMacros wish list.

Re: regular expression to select an input field?

Posted: Sat May 28, 2011 3:40 am
by adamjameslaw
This would be very useful and simplify a lot of scripting for me.

Re: regular expression to select an input field?

Posted: Sat May 28, 2011 9:01 am
by MattBell7
REGEX is in there now, not for selecting inputs, but for extracting text. see:
http://wiki.imacros.net/SEARCH

Re: regular expression to select an input field?

Posted: Sat May 28, 2011 9:26 am
by adamjameslaw
Cool - that is good for an extract. I am trying to do an autofill form fill for various pages instead of using a program such as roboform.

It would be good to be able to specify .*firstname.* rather than *irstnam*. Its for a rather specific purpose

VERSION BUILD=7210419 RECORDER=FX
ONERRORDIALOG BUTTON=YES CONTINUE=YES
SET !ERRORIGNORE YES
SET !TIMEOUT 1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:*irstnam* CONTENT=Adam
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:*astNam* CONTENT=Law
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:*urnam* CONTENT=Law
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:*addres* CONTENT=18<SP>Dundulk<SP>Drive
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:*tree* CONTENT=18<SP>Dundulk<SP>Drive
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:*ubur* CONTENT=Nedlands
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:* ATTR=ID:*ity* CONTENT=Perth