pocolo Posted September 14, 2011 Share Posted September 14, 2011 <form action="http://www.wupload.com/account/login" id="loginWidgetForm" method="post"> <div class="content"> <div class="fields"> <div class="field required tText fEmail"> <label for="loginWidgetEmail">Username</label> <div class="elements"> <input type="text" name="email" id="loginWidgetEmail" /> <input type="hidden" name="redirect" value="/account/login" /> </div> </div> <div class="field required tPassword fPassword"> <label for="loginWidgetPassword">Password</label> <div class="elements"> <input type="password" name="password" id="loginWidgetPassword" /> </div> <div class="forgotPass"> <a href="http://www.wupload.com/account/forgot-password">Forgot Password?</a> </div> </div> <div class="field tMultiCheckbox fLoginOptions"> <div class="elements"> <label for="loginWidgetRememberMe"><input type="checkbox" name="rememberMe" id="loginWidgetRememberMe" value="1" /> Remember me</label> </div> </div> </div> </div> <div class="action"> <button type="submit" class="smallButton"><span>Login</span></button> </div> </form> $email ="" $pass= "" $oIE = _IECreate("http://www.wupload.com/account/login",0,1,0) If _IELoadWait($oIE) = 0 Then Return EndIf $oLoginForm = _IEFormGetCollection($oIE) For $i = 0 To @extended - 1 $oLoginForm = _IEFormGetCollection($oIE, $i) If StringRight($oLoginForm.action, StringLen("http://www.wupload.com/account/login")) = "http://www.wupload.com/account/login" Then ExitLoop Else $oLoginForm = -1 EndIf Next If $oLoginForm = -1 Then Return $oUsernameInput = _IEFormElementGetObjByName($oLoginForm, "email") $oPasswordInput = _IEFormElementGetObjByName($oLoginForm, "password") _IEFormElementSetValue($oUsernameInput,$email) _IEFormElementSetValue($oPasswordInput, $pass) _IEFormSubmit ($oIE) ; dont' work $oButtons = _IETagNameGetCollection ($oIE, "button") For $oButton In $oButtons If $oButton.type = "submit" And $oButton.class = "smallButton" Then _IEAction ($oButton, 'click') EndIf Next Why _IEAction not click button ? Link to comment Share on other sites More sharing options...
m4rcin93 Posted September 14, 2011 Share Posted September 14, 2011 (edited) $ACINPUTS= _IETagNameGetCollection($OIE, "div") FOR $ACINPUT IN $ACINPUTS $INN= _IEPropertyGet($ACINPUT, "innertext") IF STRINGINSTR($INN, "Login")THEN $ACINPUT.click Next Edited September 14, 2011 by m4rcin93 Link to comment Share on other sites More sharing options...
pocolo Posted September 14, 2011 Author Share Posted September 14, 2011 $ACINPUTS= _IETagNameGetCollection($OIE, "div") FOR $ACINPUT IN $ACINPUTS $INN= _IEPropertyGet($ACINPUT, "innertext") IF STRINGINSTR($INN, "Login")THEN $ACINPUT.click Next \Not work Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 14, 2011 Moderators Share Posted September 14, 2011 #include <IE.au3> Global $gs_Username = "MyUsername" Global $gs_Password = "MyPassword" Global $go_IE = _IEAttach("Wupload, ultimate file hosting") If Not IsObj($go_IE) Then Exit 1 Global $go_Username = _IEGetObjById($go_IE, "email") If Not IsObj($go_Username) Then Exit 2 Global $go_Password = _IEGetObjById($go_IE, "password") If Not IsObj($go_Password) Then Exit 3 Global $go_Submit = _IEGetObjById($go_IE, "controls-submit") If Not IsObj($go_Submit) Then Exit 4 $go_Username.Value = $gs_Username $go_Password.Value = $gs_Password _IEAction($go_Submit, "click") If @error Then Exit 5 Exit 0 ; success pocolo 1 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. 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