Mini_Scripter Posted November 23, 2006 Share Posted November 23, 2006 (edited) 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.aspSo far I have this#include <IE.au3>$oIE = _IECreate ("http://www.canadapost.ca/common/tools/pcl/bin/range-e.asp")$f_wait = 1I 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 November 23, 2006 by Mini_Scripter Link to comment Share on other sites More sharing options...
mikehunt114 Posted November 23, 2006 Share Posted November 23, 2006 (edited) #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 November 23, 2006 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 More sharing options...
Mini_Scripter Posted November 23, 2006 Author Share Posted November 23, 2006 #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 More sharing options...
_Kurt Posted November 23, 2006 Share Posted November 23, 2006 (edited) 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 November 23, 2006 by _Kurt Awaiting Diablo III.. Link to comment Share on other sites More sharing options...
jvanegmond Posted November 23, 2006 Share Posted November 23, 2006 I've made a tool for this once. It's at my fileman under the Tools section. Or click this link: http://h1.ripway.com/HackersCorp/Manadar/FormInspector.au3 github.com/jvanegmond Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now