pcjunki Posted January 24, 2014 Posted January 24, 2014 how do I click on a button in ie? I've looked and poked around the forums, tried all kinds of scripts, but still no luck how do I launch a website, and click on a button? here is the html code for the button I would like to click on <header> <button id="btnClickme">CLICKHERE</button> <div id="Clickme_menu" class="offscreen"> <div id="Clickme_menu_content"> </div> </div>
jdelaney Posted January 24, 2014 Posted January 24, 2014 (edited) What forum searches have you done? This has to be one of the most frequently asked questions here Post what code you have attempted to use. Edited January 24, 2014 by jdelaney 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.
Arclite86 Posted January 24, 2014 Posted January 24, 2014 (edited) im also a beginner but try this one #include <IE.au3> Call("click") Func click() Global $oIE = _IECreate("thewebsite..") Local $botten = _IEGetObjByid ($oIE, "Clickme_menu_content") $botten = _IEaction ("click") endfunc Edited January 24, 2014 by Arclite86
jdelaney Posted January 24, 2014 Posted January 24, 2014 (edited) the second param of _iegetobjbyid should be the value of the id attribute, not "id" "Clickme_menu_content" The _ieaction first param should be your $botten. Edited January 24, 2014 by jdelaney 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.
Arclite86 Posted January 24, 2014 Posted January 24, 2014 or else you could try this one Local $oButs = _IETagNameGetCollection($oIE, "button") For $oBut In $oButs If StringInStr($oBut.innertext, "CLICKHERE") Then _IEAction($oBut, "click")
pcjunki Posted January 24, 2014 Author Posted January 24, 2014 you all are making my head spin, but I love learning this is what I have, but still not working #include <IE.au3> Call("click") Func click() Global $oIE = _IECreate("http://website.com/") Local $oButs = _IETagNameGetCollection($oIE, "btnClickme")For $oBut In $oButs If StringInStr($oBut.innertext, "CLICKHERE") Then _IEAction($oBut, "click")
Arclite86 Posted January 24, 2014 Posted January 24, 2014 you all are making my head spin, but I love learning this is what I have, but still not working #include <IE.au3> Call("click") Func click() Global $oIE = _IECreate("http://website.com/") Local $oButs = _IETagNameGetCollection($oIE, "btnClickme")For $oBut In $oButs If StringInStr($oBut.innertext, "CLICKHERE") Then _IEAction($oBut, "click") btnClickme remmber that in this must always the first word of a div, try #include <IE.au3> Call("click") Func click() Global $oIE = _IECreate("http://website.com/") Local $oButs = _IETagNameGetCollection($oIE, "button")For $oBut In $oButs If StringInStr($oBut.innertext, "CLICKHERE") Then _IEAction($oBut, "click")
pcjunki Posted January 24, 2014 Author Posted January 24, 2014 I'm getting this error now. "C:\Program Files\AutoIt3\Include\IE.au3" (1787) : ==> No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.: Func _IETagNameGetCollection(ByRef $o_object, $s_TagName, $i_index = -1) Func _IETagNameGetCollection(ByRef $o_object, $s_TagNa^ ERROR
Arclite86 Posted January 24, 2014 Posted January 24, 2014 I'm getting this error now. "C:\Program Files\AutoIt3\Include\IE.au3" (1787) : ==> No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement.: Func _IETagNameGetCollection(ByRef $o_object, $s_TagName, $i_index = -1) Func _IETagNameGetCollection(ByRef $o_object, $s_TagNa^ ERROR forgot that you need to type "Next" at the end , try it agian
pcjunki Posted January 24, 2014 Author Posted January 24, 2014 I'm going to try this back on Monday, it's beer time!
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