SsCriPteR Posted March 13, 2015 Posted March 13, 2015 Hello. Website code: <span class="button_middle">Acesso</span> My code: Local $button = _IEGetObjByName ($oIE, "Acesso") _IEAction($button , "Click") I'm trying to make it click on the button but it isn't working. Any help pls?
SsCriPteR Posted March 13, 2015 Author Posted March 13, 2015 I'm going to explain better what i'm trying to do. My Script: #include <IE.au3> call ("Autologin") Login() Func Login() Global $oIE = _IECreate ("http://www.EXAMPLE.com") $iVisible = 0 Local $user = _IEGetObjByName ($oIE, "user") Local $password = _IEGetObjByName ($oIE, "password") _IEFormElementSetValue($user, "USERNAME") _IEFormElementSetValue($password, "PASSWORD") EndFunc I'm trying to create a auto login. My problem is that the login button doesn't have any id or name, so i can't use _IEGetObjByName, the website code for that button is: <span class="button_middle">Acesso</span> Can anyone help me pls? thank you
DocTorCoder Posted March 13, 2015 Posted March 13, 2015 (edited) You are using this tutorial isn't? Better ideea is to look at this post,could be very helpful to create a autologin with post request: '?do=embed' frameborder='0' data-embedContent>> Or : $sPD = "data to be send" ; this data must be something like a cookie(use http headers to find out how to use it) $server "www.example.com" ; Creating the object $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") $oHTTP.Open("POST", $server, False) $oHTTP.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded") ; Performing the Request $oHTTP.Send($sPD) ; Download the body response if any and get the server status response code $oReceived = $oHTTP.ResponseText $oStatusCode = $oHTTP.Status ; This depend of your server response code,could be any error code If ($oStatusCode <> 200) then MsgBox(4096, "Response code", $oStatusCode) EndIf Edited March 13, 2015 by DocTorCoder DocTorCoder
Moderators SmOke_N Posted March 13, 2015 Moderators Posted March 13, 2015 >IE extended library may help if you're using IE9 or higher. _IEEx_GetObjByClassName Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
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