Jump to content

Enter info on site and submit


Recommended Posts

I'm trying to automate entering info on web site and submitting.

I've looked at all the example but still cant figure this out.

The web site is: http://www.canadapost.ca/common/tools/pcl/bin/range-e.asp

So far I have this

#include <IE.au3>

$oIE = _IECreate ("http://www.canadapost.ca/common/tools/pcl/bin/range-e.asp")

$f_wait = 1

I need to enter a postal code and submit can any one guide me?

I have alos tried:

#include <IE.au3>

$oIE = _IECreate ("http://www.canadapost.ca/common/tools/pcl/bin/range-e.asp")

$oForm = _IEFormGetObjByName ($oIE, "f")

$oQuery = _IEFormElementGetObjByName ($oForm, "q")

_IEFormElementSetValue ($oQuery, "Postal Code")

_IEFormSubmit ($oForm)

Thanks

Edited by Mini_Scripter
Link to comment
Share on other sites

#include <IE.au3>

$postalcode = "your postal code here"
$url = "http://www.canadapost.ca/common/tools/pcl/bin/range-e.asp"

$oIE = _IECreate($url, 1)
$oForm = _IEFormGetObjByName($oIE, "searchRange")
$oCode = _IEFormElementGetObjByName($oForm, "postal_code2")
_IEFormElementSetValue($oCode, $postalcode)
_IEFormImageClick($oForm, "Images/en/btnSubmit_of.gif")

You have to get the names or properties of the objects specific to the page you are trying to work with.

Edited by mikehunt114
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

#include <IE.au3>

$postalcode = "your postal code here"
$url = "http://www.canadapost.ca/common/tools/pcl/bin/range-e.asp"

$oIE = _IECreate($url, 1)
$oForm = _IEFormGetObjByName($oIE, "searchRange")
$oCode = _IEFormElementGetObjByName($oForm, "postal_code2")
_IEFormElementSetValue($oCode, $postalcode)
_IEFormImageClick($oForm, "Images/en/btnSubmit_of.gif")

You have to get the names or properties of the objects specific to the page you are trying to work with.

That worked great!!

I gues I must do some more reading

Thanks a lot!

Link to comment
Share on other sites

Hey,

I had the same problem earlier, and this helped me out. But I was wondering if you could take the information given on the site and set a label the information that was created. In other words, it reads what information was given on the (hidden) site and displays it in the label

Example for the gui:

#include <IE.au3>

GUICreate("test")
$input  = GUICtrlCreateInput("", 10, 10)
$button = GUICtrlCreateButton("search",10,40)
GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $button
            $postalcode = GUICtrlRead($input)
            $url = "http://www.canadapost.ca/common/tools/pcl/bin/range-e.asp"
            $oIE = _IECreate($url, 1)
            $oForm = _IEFormGetObjByName($oIE, "searchRange")
            $oCode = _IEFormElementGetObjByName($oForm, "postal_code2")
            _IEFormElementSetValue($oCode, $postalcode)
            _IEFormImageClick($oForm, "Images/en/btnSubmit_of.gif")
    EndSelect
WEnd
Edited by _Kurt

Awaiting Diablo III..

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...