Valhalla1 Posted June 27, 2008 Share Posted June 27, 2008 (edited) here's the html code snippet which produces a couple buttons I need to click in my script. <div align="center"> <button onclick="_submit(); return false;">Calculate</button> <button onclick="_clear(); return false;">Clear</button> </div> I'm trying to have my script click on either button but having trouble. I've tried: $oSubmit = _IEGetObjByName ($oIE, "Calculate") _IEAction ($oSubmit, "click") gives a warning: --> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: Calculate, Index: 0)--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType Edited June 27, 2008 by Valhalla1 Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 27, 2008 Share Posted June 27, 2008 here's the html code snippet which produces a couple buttons I need to click in my script. <div align="center"> <button onclick="_submit(); return false;">Calculate</button> <button onclick="_clear(); return false;">Clear</button> </div> I'm trying to have my script click on either button but having trouble. I've tried: $oSubmit = _IEGetObjByName ($oIE, "Calculate") _IEAction ($oSubmit, "click") gives a warning: --> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: Calculate, Index: 0)--> IE.au3 V2.4-0 Error from function _IEAction, $_IEStatus_InvalidDataType The text in the button is "innertext", not "name". There isn't a function to find it by innertext, so you get the collection of "button" tags and loop through them: $colButtons = _IETagNameGetCollection($oForm, "button") $iButtonCnt = @extended ConsoleWrite("Debug: There are " & $iButtonCnt & " buttons in the collection." & @LF) Global $oCalc, $oClear For $oButton In $colButtons If $oButton.innertext = "Calculate" Then $oCalc = $oButton If $oButton.innertext = "Clear" Then $oClear = $oButton Next _IEAction($oCalc, "click") _IEAction($oClear, "click") Note you need to have already drilled down to the Form, Frame, iFrame, whatever already. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Valhalla1 Posted June 27, 2008 Author Share Posted June 27, 2008 bingo thanks, fantastic 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