computergroove Posted September 21, 2014 Share Posted September 21, 2014 (edited) <DIV class=navbar-header><BUTTON class=navbar-toggle type=button data-target=".navbar-collapse" data-toggle="collapse"> <I style="COLOR: #fff" class="fa fa-bars"></I></BUTTON> Trying to get IE to click on the above control but I cannot figure out the syntax. Edited September 21, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Kyan Posted September 21, 2014 Share Posted September 21, 2014 I don't like IE UDF, is too slow, learn about http and use winHTTP, is easy to use for simple tasks like this one. check out this example: Assuming you want to click the DIV you were searching for above (though most buttons are <inputs>) #include <IE.au3> $oIE = _IECreate ("http://www.test.com", 0, 0, 1, 0) $oCorrectObj = "" $tags = $oIE.document.GetElementsByTagName("div") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "levelBar" Then $oCorrectObj = $tag MsgBox(0, "Level: ", "Level found :)") ExitLoop EndIf Next If IsObj ( $oCorrectObj ) Then _IEAction ($oCorrectObj, "click") EndIF _IEQuit ($oIE) edit: just realized this is a super old post, but the same structure can be used for whatever your element is if there's only a button with navbar-toggle class is straight forward Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better Link to comment Share on other sites More sharing options...
computergroove Posted September 21, 2014 Author Share Posted September 21, 2014 I dont mind using ff or chrome but the documentation is equally as perplexing to me. The above code did not work to click the button. Any other suggestions? Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
Kyan Posted September 22, 2014 Share Posted September 22, 2014 weird, I replaced everything thats needed, you just need to specify the actual url #include <IE.au3> $oIE = _IECreate ("http://www.test.com", 0, 0, 1, 0) $oCorrectObj = "" $tags = $oIE.document.GetElementsByTagName("BUTTON ") For $tag in $tags $class_value = $tag.GetAttribute("class") If string($class_value) = "navbar-toggle" Then $oCorrectObj = $tag MsgBox(0, "Level: ", "Level found :)") ExitLoop EndIf Next If IsObj ( $oCorrectObj ) Then _IEAction ($oCorrectObj, "click") EndIF _IEQuit ($oIE) I dont mind using ff or chrome but the documentation is equally as perplexing to me. yeah, I know, but once you learned the basics of http it will be very simple, use _WinHttpSimpleSendRequest() for submiting whatever that button does. PS: In IE you can view the page, in winhttp you work only with code, you have to know what you want to do and how requests work. Heroes, there is no such thing One day I'll discover what IE.au3 has of special for so many users using it.C'mon there's InetRead and WinHTTP, way better Link to comment Share on other sites More sharing options...
junkew Posted September 22, 2014 Share Posted September 22, 2014 '?do=embed' frameborder='0' data-embedContent>> simplespy will give you the standard code for free you only have to cleanup for your own purposes FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
computergroove Posted September 22, 2014 Author Share Posted September 22, 2014 (edited) Is simplespy the UIA_V0_51.zip download? I dont see simplespy.au3 available for download in the top post. Edit - Yes it is. Edited September 22, 2014 by computergroove Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html 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