Loop-Csv-2-Web --- Button Woes

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.

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.

Loop-Csv-2-Web --- Button Woes

by embryo on Fri Sep 01, 2017 2:19 am

Hello-

I'm very new to iMacros...about 3 hours into it thus far.

I need to insert 1047 records from a CSV spreadsheet into a 3rd party database.
They require that the data be inserted one record at a time, via form posts.

I followed the http://wiki.imacros.net/Demo-Loop-Csv-2-Web demo and configured it for my use:
Code: Select all
VERSION BUILD=10.4.28.1074
'Uses a Windows script to submit several datasets to a website, e. g. for filling an online database
TAB T=1     
TAB CLOSEALLOTHERS 
' Specify input file (if !COL variables are used, IIM automatically assume a CSV format of the input file
'CSV = Comma Separated Values in each line of the file
SET !DATASOURCE IMPORTFILE.csv
'Start at line 2 to skip the header in the file
SET !LOOP 2
'Increase the current position in the file with each loop
SET !DATASOURCE_LINE {{!LOOP}}
' Fill web form   
URL GOTO=http://www.mydomain.com/myformpage.htm
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:Vendor_ID CONTENT={{!COL1}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:Vendor_Key CONTENT={{!COL2}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:Lead_ID CONTENT={{!COL3}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:family_members[0]Relation CONTENT={{!COL4}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:family_members[0]First_Name CONTENT={{!COL5}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:family_members[0]Last_Name CONTENT={{!COL6}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:Street_Address CONTENT={{!COL7}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:City CONTENT={{!COL8}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:County CONTENT={{!COL9}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:State CONTENT={{!COL10}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:Zip CONTENT={{!COL11}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:Phone1 CONTENT={{!COL12}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:DOB CONTENT={{!COL13}}
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:demo ATTR=NAME:Comments CONTENT={{!COL14}}
TAG POS=1 TYPE=BUTTON:submit FORM=ID:demo ATTR=TXT:Submit
TAG POS=1 TYPE=A ATTR=TXT:*Back*


It populates all the correct fields in the browser emulator, but always returns an error indicating that it can't find the HTML element for the forum button:
Error -1300: Cannot find HTML element of type "BUTTON:submit" with attribute(s) "TXT:Submit".. Line 28: TAG POS=1 TYPE=BUTTON:submit FORM=ID:demo ATTR=TXT:Submit

I've tried changing it to this:
Code: Select all
TAG POS=1 TYPE=[b]INPUT[/b]:submit FORM=ID:demo ATTR=TXT:Submit

..same error...

This is the form I created to macro-submit 1047 times:

Code: Select all
<form id="demo" name="leadinserter" method="POST" action="https://hapi.insuresync.net/leadpost/vendor_process.php">
VendorID;      <input type="text" maxlength=30 name="Vendor_ID" value=""><br>
Vendor Key:      <input type="text" maxlength=30 name="Vendor_Key" value=""><br>
Lead ID:      <input type="text" maxlength=30 name="Lead_ID" value=""><br>
Relation:      <input type="text" maxlength=30 name="family_members[0]Relation" value=""><br>
First Name:      <input type="text" maxlength=30 name="family_members[0]First_Name" value=""><br>
Last Name:      <input type="text" maxlength=30 name="family_members[0]Last_Name" value=""><br>
Street Address:      <input type="text" maxlength=30 name="Street_Address" value=""><br>
City:      <input type="text" maxlength=30 name="City" value=""><br>
County:      <input type="text" maxlength=30 name="County" value=""><br>
State:      <input type="text" maxlength=30 name="State" value=""><br>
Zip:      <input type="text" maxlength=30 name="Zip" value=""><br>
Phone:      <input type="text" maxlength=30 name="Phone1" value=""><br>
Date of Birth:      <input type="text" maxlength=30 name="DOB" value=""><br>
Comments/FamilyD:      <input type="text" maxlength=30 name="Comments" value=""><br>
[b]<button type="submit" name="b1" value="Submit">Submit</button>[/b]
</form>


I tried that...and this for the button:
Code: Select all
<input type="submit" value="Submit">

..but it's always the same error.

What's the trick?
embryo
 
Posts: 2
Joined: Fri Sep 01, 2017 1:30 am

Re: Loop-Csv-2-Web --- Button Woes

by embryo on Fri Sep 01, 2017 5:12 am

UPDATE:
I got it to work finally, with this for the button...and clearing cache a million times in my browser on the html page:
Code: Select all
TAG POS=1 TYPE=BUTTON:submit FORM=ID:demo ATTR=TXT:Submit


I'm not sure what this line is supposed to do, but it kept throwing a "Can't find HTML Element.." error, so I removed it and gave it another try...
Code: Select all
TAG POS=1 TYPE=A ATTR=TXT:*Back*


I set the repeat to 1047, clicked PLAY > and watched it go!!!!
Wow that's fast... beats the hell out of the alternative!

Now I just have to wait until someone confirms the data all went in like it was supposed to.

Cool tool.
embryo
 
Posts: 2
Joined: Fri Sep 01, 2017 1:30 am


Return to General Support & Discussions

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], Majestic-12 [Bot] and 6 guests

-->