Need more than 3 variables

Information related to the use of iMacros for form filling and data upload.
Post Reply
User avatar
Tech Support
Posts: 5003
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Need more than 3 variables

Post by Tech Support » Mon Mar 19, 2007 2:32 pm

Q: I use the PROMPT command in my macro for user input. However, I need to assign more than three variables.

A: The problem is that iMacros PROMPT command can only set the three variables !VAR1, !VAR2 and !VAR3. If more then three pieces of user input are needed you simply run out of variables. The solution is to take the user input step by step.

First, let the macro navigate to the site where the input is needed. Then use the PROMPT command to ask for the first three inputs and fill the webform with these three pieces of information using the TAG command.

Now the variables are free to be used with the PROMPT command again since the input has already been given to the website. You can continue with this procedure until you have filled the entire form.

iOpus Support
Topdogie01
Posts: 4
Joined: Mon Jun 23, 2008 5:25 am

Re: Need more than 3 variables

Post by Topdogie01 » Mon Jun 23, 2008 5:50 am

Yes this works, but what if we would like to loop and call back the original variable that was set before we changed it for the 4th variable? is there a way we could use another included variable?
User avatar
Tech Support
Posts: 5003
Joined: Tue Sep 20, 2005 7:25 pm
Contact:

Re: Need more than 3 variables

Post by Tech Support » Fri Jun 27, 2008 9:22 pm

Topdogie01, do you have an example for such a task?
Topdogie01
Posts: 4
Joined: Mon Jun 23, 2008 5:25 am

Re: Need more than 3 variables

Post by Topdogie01 » Sat Jun 28, 2008 7:38 am

[code]
VERSION BUILD=5220125
TAB T=1
URL GOTO=http://website.com
PROMPT Please<SP>Enter<SP>The<SP>Name<SP>For<SP>Email<SP>To<SP>Be<SP>Used !VAR1
PROMPT Please<SP>Enter<SP>The<SP>First<SP>Name !VAR2
PROMPT Please<SP>Enter<SP>The<SP>Last<SP>Name !VAR3
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:Email CONTENT={{!VAR1}}@service.com
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:ConfirmEmail CONTENT={{!VAR1}}@service.com
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:aspnetForm ATTR=NAME:Password CONTENT=aaaaa1
TAG POS=1 TYPE=INPUT:PASSWORD FORM=NAME:aspnetForm ATTR=NAME:ConfirmPassword CONTENT=aaaaa1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:FirstName CONTENT={{!VAR2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:LastName CONTENT={{!VAR3}}
TAG POS=1 TYPE=SELECT FORM=NAME:aspnetForm ATTR=NAME:Regions CONTENT=5
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:PostalCode CONTENT=90210
TAG POS=1 TYPE=SELECT FORM=NAME:aspnetForm ATTR=NAME:Month CONTENT=7
TAG POS=1 TYPE=SELECT FORM=NAME:aspnetForm ATTR=NAME:Day CONTENT=4
TAG POS=1 TYPE=SELECT FORM=NAME:aspnetForm ATTR=NAME:Year CONTENT=33
TAG POS=1 TYPE=INPUT:RADIO FORM=NAME:aspnetForm ATTR=NAME:gender&&VALUE:F CONTENT=F
PROMPT Please<SP>Type<SP>The<SP>Text<SP>In<SP>The<SP>Image !VAR4
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:aspnetForm ATTR=NAME:ctl00$cpMain$Captcha$CaptchaControl$captchaResponseTextBox CONTENT={{!VAR4}}
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=NAME:aspnetForm ATTR=ID:Terms CONTENT=YES
TAG POS=1 TYPE=INPUT:SUBMIT FORM=NAME:aspnetForm ATTR=NAME:ctl00$cpMain$Submit$SubmitButton&&VALUE:Sign<SP>Up
[/code]

that is the code im running. is there a way i can get a 4th variable, or possibly combine variable 2 and 3 and have imacros separate the first part of the variable and 2nd part? or is there another variable that i can set for the captcha from the user input? and is there a way i can make it loop back to the beginning? give it a GOTO command?
bsmyth292
Posts: 0
Joined: Fri Oct 24, 2008 8:03 am

Re: Need more than 3 variables

Post by bsmyth292 » Fri Oct 24, 2008 8:18 am

Yes, having only three user-defined variables seems to be a limitation. For example, I'm trying to create a macro that gathers first name, middle name, last name, and business address for a person. When the user hits return, iMacros opens up multiple tabs, each which direct to a different search site, and they all search for these four variables at the same time.

This would be a great timesaver, but I only have three variables to work with, so I can't do this. One would think that the middle name variable not so important and so might be dropped and the variable used for address data. However, the middle name is very important to distinguish, for example, Tom A. Smith from Tom B. Smith with common names.

The recommended technique of visiting a page to dump the three variables before acquiring new user input doesn't really work in this case, because what we are trying to do is input once, search many sites simultaneously. Again, that's what would save us a lot of time and work.

I'm thinking that some kind of workaround to this might be to somehow, on a local HTTP server, create an HTML "target" page that has fields for each of these four inputs which form URLs to the search sites I want to visit. I visit this page from within iMacros and after the initial submit button is clicked, iMacros takes it from there, scraping the info I need from the results of each search. I'm not sure how this would play out in practice, however. I'll have to play around before I know if this will work.
artb
Posts: 3
Joined: Tue Aug 11, 2009 4:50 pm

Re: Need more than 3 variables

Post by artb » Tue Oct 13, 2009 1:40 pm

Here's a couple workarounds to the problem:
1)
The EXTRACT command is itself a 4th variable.
EXTRACT can be used for content, too
CONTENT={{!VAR1}}
CONTENT={{!VAR2}}
CONTENT={{!VAR3}}
CONTENT={{!EXTRACT}}

2)
For limitless use of variables, use tabs.
Data scrape and SET the first 4 variables from the source web page on the first Tab.
Then, open the destination form in a new Tab
TAB OPEN
URL GOTO:http://www.your_destination_form.com
TAB T=2
use up the variables, set them NULL, then switch back to the first tab and scrape more data
TAB= 1
This tells imacros to go back and forth scraping and depositing data until your done.
Post Reply