regular expression to select an input field?

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
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
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

regular expression to select an input field?

Post by tata668 » Sun Jun 14, 2009 2:41 am

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!
tata668
Posts: 42
Joined: Sun Jun 14, 2009 2:34 am

Re: regular expression to select an input field?

Post by tata668 » Sun Jun 14, 2009 2:55 am

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!
Marcia, Tech Support
Posts: 1095
Joined: Thu Jan 29, 2009 1:10 pm

Re: regular expression to select an input field?

Post by Marcia, Tech Support » Mon Jun 15, 2009 10:34 am

Hello,

Thank you for your appreciation and suggestion.

I will add the Regular Expression to iMacros wish list.
Regards,

Marcia
adamjameslaw
Posts: 11
Joined: Tue Apr 04, 2006 3:40 am

Re: regular expression to select an input field?

Post by adamjameslaw » Sat May 28, 2011 3:40 am

This would be very useful and simplify a lot of scripting for me.
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: regular expression to select an input field?

Post by MattBell7 » Sat May 28, 2011 9:01 am

REGEX is in there now, not for selecting inputs, but for extracting text. see:
http://wiki.imacros.net/SEARCH
adamjameslaw
Posts: 11
Joined: Tue Apr 04, 2006 3:40 am

Re: regular expression to select an input field?

Post by adamjameslaw » Sat May 28, 2011 9:26 am

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
Post Reply