Sign in to follow this  
Followers 0
ShakeelAhmad

Excel to Webform

14 posts in this topic

#1 ·  Posted (edited)

Hello

I have created following script to copy data from excel file and to paste it in a web form. This form was filled manually and the fastest filler takes 2 minutes but my script is filling the form withing 29 seconds. form has about 48 fields but i am sharing some example fields:

ClipPut("")
sleep(100)
WinActivate("Microsoft Excel")
sleep(100)
send("^c")
sleep(30)
Local $fname = ClipGet()
sleep(30)
$fname = StringStripCR($fname)
$fname = StringStripWS($fname, 1)
$fname = StringStripWS($fname, 2)
sleep(30)
send("{TAB}")
sleep(30)
send("^c")
sleep(30)
Local $lname = ClipGet()
sleep(30)
$lname = StringStripCR($lname)
$lname = StringStripWS($lname, 1)
$lname = StringStripWS($lname, 2)
sleep(30)
send("{TAB}")
sleep(30)
send("^c")
sleep(30)
Local $email = ClipGet()
sleep(30)
$email = StringStripCR($email)
$email = StringStripWS($email, 1)
$email = StringStripWS($email, 2)
sleep(30)
etc...........................................................................



;----------------------------------
;COPY PROCESS COMPLETED / paste process starts here
;----------------------------------
;send("^{PGDN}")
WinActivate("Title of my web form")
sleep(130)
send($fname)
sleep(130)
send("{TAB}")
sleep(130)
send($lname)
sleep(130)
send("{TAB}")
sleep(130)
send($email)
sleep(130)
etc.................................................................

the script is working perfectly. I want to improve it and want to learn some new things.

1) When a form is completed we have to go to second row in excel and open new form and the process is run again. Is there a way that i could use qlite which reads all the data from excel file at once and then paste it to web forms (complete a form, minimize it, open new, and fill it from 2nd row and so on.............)

2) The form is submitted from Pakistan with US Identity by using a vpn software HMA Pro. A form is uploaded, then ip is changed which takes about 10 to 20 seconds then second form is uploaded and then again IP is changed............. which takes so much time.

I have seen a software which collects all the data from excel and fills form and submits them by using some proxy scraper type software and whole process is done in background, nothing can be seen on screen. Does anyone know about this? please provide help.

Thanks and regards Edited by ShakeelAhmad

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

You shouldn't double post :naughty:

This thread is in the correct forum because you ask a question and want some advice.

The Example Scripts forum is definitely the wrong place to post your thread.

Please carefully read the forum rules (link can be found in the lower right corner of this page).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Use the _Excel and _IE functions...they are much more relaible (don't have to worry about the tab not being picked up durring the run), and will take down that 30 seconds enter time to seconds (if even)

1 person likes this

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

And please wrap AutoIt code you post in [autoit][/autoit] tags.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Use the _Excel and _IE functions...they are much more relaible (don't have to worry about the tab not being picked up durring the run), and will take down that 30 seconds enter time to seconds (if even)

Please can you provide me a sample script if there are only two columns in excel (first name and last name) and two feilds are in web form to paste.

Thanks

Share this post


Link to post
Share on other sites

Start with _ExcelBookOpen, _ExcelReadArray and _ExcelBookClose to read your data.

Functions _IECreate or _IEAttach, _IEFormGetObjByName and _IEFormElementSetValue, _IEQuit will show how to insert the data.

Details plus examples can be found in the help file.

2 people like this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Start with _ExcelBookOpen, _ExcelReadArray and _ExcelBookClose to read your data.

Functions _IECreate or _IEAttach, _IEFormGetObjByName and _IEFormElementSetValue, _IEQuit will show how to insert the data.

Details plus examples can be found in the help file.

I have tried as you replied and it worked for me perfectly.

I don't have words to thank you..........

Thank you very much.

Share this post


Link to post
Share on other sites

Glad to be of service :D


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Glad to be of service :D

Above method is working for me perfectly. Can I do all this on firefox?

Share this post


Link to post
Share on other sites

There is a available. Never used it myself so I can't tell if you can do everything you need.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Any news whether you managed to get this working in the end?

Share this post


Link to post
Share on other sites

Looks like he got it working for IE. As there were no questions regarding FF I assume he didn't need/try it.

What do you need?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Looks like he got it working for IE. As there were no questions regarding FF I assume he didn't need/try it.

What do you need?

 

Sorry for not keeping in touch.

Yes the above methods worked for me but Now I badly need to do the same in firefox but I have no idea from where to start.

Please help to understand the usage of firefox udf

I just want to put some values to a form input text boxes in firefox.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Hello, I have issues doing something very similar.

I got the Excel part working perfectly. However, when I open the form, I can't write to it. The form is very simple. One text box and the submit button. then it goes and deos it's thing.

<form action="charge_number_details.cfm" name="get_charge_number_details" method="post" onSubmit="return errorCheck();">
    <table>
      <tr>
        <td width = "120">Charge Number: </td>
        <td width ="255"><input type="text" maxlength="21" size="35" name="charge_number"> </td>
        <td>Enter a whole charge number or any beginning part of a charge number to return all charge numbers for that string (ie. B201) </td>
      </tr>
      <tr height="45px" valign="bottom" ><td>&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" value="Get Details"></td></tr>
    </table>
</form>

now I have tried all examples I could find but nothing.. Below is a test code I am using.

#include <IE.au3>

Local $oIE = _IECreate("https://thesite.com/")
WinActivate("get_charge_number_details")
Local $oForm = _IEFormGetObjByName($oIE, "get_charge_number_details")
Local $oText = _IEFormElementGetObjByName($oForm, "charge_number")
_IEFormElementSetValue($oText, "xxxx")

Any help or pointers is super appreciated.

Thanks..

Edited by winkergior

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0