Jump to content

Scrolling Website for Data entry help


Kidney
 Share

Recommended Posts

Hey guys!

i havent posted much on here but i have read through many threads and picked up on many useful tips and tricks on many scripts i have wrote so id just like to say thanks for the awesome support and good explanations to help understand autoIT.

With that being said, i have a question that you guys might be able to shed some light on if you have ever come across something like this.

My friend has a data entry job for his moms real-estate business and it includes filling out these forms online. not too long ago, the website he was getting his information from just switched from having scanned in jpeg's of hand written forms to electronic forms. i have successfully collected all of the info from the forms he gets online already. now the part im not sure about is transferring that info to the other website.

here is a screenshot of the website he will be filling out just as reference:

Posted Image

here is the script i have already that fills out the Dates, times and the SubAgentID:

Func Fill()
    $ContactTime = StringReplace($ContactTime, "M", " ")
    $ContactTime = StringReplace($ContactTime, ":", " ")
    $ContactTime = StringReplace($ContactTime, " ", "")
    $StringL = StringTrimRight($ContactTime, 3)
    $StringR = StringRight($ContactTime, 3)
    $StringL2 = StringLeft($StringR, 2)
    $AMPM = StringRight($ContactTime, 1)

    If $StringL = 10 Then
        $StringL3 = "1"
    Else
        $StringL3 = "0" & $StringL
        If $StringL = 11 Then
        $StringL3 = "11"
        Else
        $StringL3 = "0" & $StringL
        If $StringL = 12 Then
        $StringL3 = "12"
        Else
        $StringL3 = "0" & $StringL
            EndIf
        EndIf
    EndIf

    $FinalString = $StringL3 & "{TAB}" & $StringL2 & "{TAB}" & $AMPM

    MouseClick("Left", 588, 502, 1, 0)
    Sleep(100)
    Send($ContactDate)
    SLeep(200)
    Send("{TAB}")
    Sleep(200)
    Send($FinalString)

    $SecondTime = StringReplace($SecondTime, "M", " ")
    $SecondTime = StringReplace($SecondTime, ":", " ")
    $SecondTime = StringReplace($SecondTime, " ", "")
    $StringL = StringTrimRight($SecondTime, 3)
    $StringR = StringRight($SecondTime, 3)
    $StringL2 = StringLeft($StringR, 2)
    $AMPM = StringRight($SecondTime, 1)


    If $StringL = 10 Then
        $StringL3 = "1"
    Else
        $StringL3 = "0" & $StringL
        If $StringL = 11 Then
        $StringL3 = "11"
        Else
        $StringL3 = "0" & $StringL
        If $StringL = 12 Then
        $StringL3 = "12"
        ElseIf $SecondTime = "" Then
        $StringL3 = $StringL
        Else
        $StringL3 = "0" & $StringL
            EndIf
        EndIf
    EndIf

    $FinalString = $StringL3 & "{TAB}" & $StringL2 & "{TAB}" & $AMPM
    Sleep(100)
    Send("{TAB}")
    Sleep(200)
    Send($SecondDate)
    SLeep(200)
    Send("{TAB}")
    Sleep(200)
    Send($FinalString)
    SLeep(200)
    Send("{TAB}")
    Sleep(200)
    Send($AgentID)

EndFunc

now for the question and your guys ideas. i know how to code the rest of it to fill out the rest of the info, but how should i have it scroll down the page so it can fill out the form? i have tried the MouseWheel function but sometimes its a little inaccurate. are there anyways to make it stop and a specific point? any way to increase accuracy of entry?

one idea i had was to work backwards. as in, fill it out from the bottom and go upwards since the form is always the same. is there a better way that u guys can think of or something i should experiment with??

Anything is helpful!

Link to comment
Share on other sites

kidney,

i have successfully collected all of the info from the forms he gets online already

In what form, flat file on PC, collection of paper, etc

A better technique for populating a WEB page is to use Dale Holm's excellent IE.udf. See the help file for functions prefixed with "_IE".

kylomas

Edit: add reference link

see this link for example of populating a WEB form

Edited by kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
Share on other sites

ok so in the _IE_Example, it opens up 'form' and i see that it has radio buttons and check boxes. it also has the the source code u need to select them?? is that correct? if so, here is the source for the website in the s/s of the radio buttons:

<td><input id="ctl00_MainContent_rbAddrGivenFor_0" type="radio" name="ctl00$MainContent$rbAddrGivenFor" value="1" /><label for="ctl00_MainContent_rbAddrGivenFor_0">Home</label></td><td><input id="ctl00_MainContent_rbAddrGivenFor_1" type="radio" name="ctl00$MainContent$rbAddrGivenFor" value="3" onclick="javascript:alert('You MUST enter the name of the ACTUAL BUSINESS operating at the Address.');" /><label for="ctl00_MainContent_rbAddrGivenFor_1">Business (Specify Below)</label></td><td><input id="ctl00_MainContent_rbAddrGivenFor_2" type="radio" name="ctl00$MainContent$rbAddrGivenFor" value="5" /><label for="ctl00_MainContent_rbAddrGivenFor_2">Condominium</label></td>

    </tr><tr>
        <td><input id="ctl00_MainContent_rbAddrGivenFor_3" type="radio" name="ctl00$MainContent$rbAddrGivenFor" value="2" /><label for="ctl00_MainContent_rbAddrGivenFor_3">Apartment</label></td><td><input id="ctl00_MainContent_rbAddrGivenFor_4" type="radio" name="ctl00$MainContent$rbAddrGivenFor" value="4" /><label for="ctl00_MainContent_rbAddrGivenFor_4">Mobile/Modular Home</label></td><td><input id="ctl00_MainContent_rbAddrGivenFor_5" type="radio" name="ctl00$MainContent$rbAddrGivenFor" value="-1" /><label for="ctl00_MainContent_rbAddrGivenFor_5">Other (Describe Below)</label></td>

sry its really wide. but i have little to no experience with IE.au3

for an example, can u show me what command u would use to select the Airplane radio button in the _IE_Example?? i know its asking a lot but once i can see it done then i can usually figure the more complex things.

Edited by Kidney
Link to comment
Share on other sites

kylomas,

ok after looking at it now i understand what u r saying and some what how to use the IE.au3

/e

ok now i have a questions. using the code i provided above (post #7), how would i seletc the "Home" radio button??

just to view it easier:

<input id="ctl00_MainContent_rbAddrGivenFor_0" type="radio" name="ctl00$MainContent$rbAddrGivenFor" value="1" />
<label for="ctl00_MainContent_rbAddrGivenFor_0">Home</label>

which do i use for the $s_string and the $s_name??

i tried:

$s_string = ctl00_MainContent_rbAddrGivenFor_0

$s_name = ctl00$MainContent$rbAddrGivenFor

but no luck. here is the code as of right now but without the username and password. i also couldnt get the submit button to work :D

#include <IE.au3>
$oIE = _IECreate ("https://agents.jmadjustment.com/SignOn.aspx?MSG=MSG_SESSION_EXPIRED",1)
$o_form = _IEFormGetObjByName ($oIE, "ctl01")
$o_login = _IEFormElementGetObjByName ($o_form, "AgentID")
$o_password = _IEFormElementGetObjByName ($o_form, "Password")
$o_signin = _IEFormElementGetObjByName ($o_form, "btnSubmit")
$username = "username"
$password = "pass"
_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)
Send("{ENTER}")
_IENavigate($oIE, "https://agents.jmadjustment.com/UpdateFieldCallResult.aspx?CustomerID=1974966&CustAddressID=0")
$o_form = _IEFormGetObjByName ($oIE, "aspnetForm")
$o_Contact = _IEFormElementGetObjByName ($o_form, "ctl00$MainContent$txtContactDate")
$Contact = "Test"
_IEFormElementSetValue ($o_Contact, $Contact)
_IEFormElementRadioSelect ($o_form, "Apartment", "ctl00_MainContent_rbAddrGivenFor_3")
Edited by Kidney
Link to comment
Share on other sites

kidney,

Don't use "SEND" to click, see IEAction in the help file, however, I am no expert, in fact have not used these till your post.

There are numerous examples if you search the forum.

If you need more in depth help one of the experts will assist you.

When asking for help you will alway need the following:

1 - description of problem in terms of actual VS expected results, in detail

2 - example of code producing the problem

Good Luck,

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...