ilikecl Posted February 6, 2020 Posted February 6, 2020 Hi All, I've been using AutoIt to automate logging into a website and doing some setting updates for several years now. The services as updated its login page a couple times over the years, but I've always managed to get it going. However, this latest update has me stumped on how to use AutoIt for it. I am not a developer, so I am at a loss on what to do here. I am able to fill in the form for email and password using _IEGetObjByName, but the log in button no longer has a name specified. I've searched the forums and tried a couple of different solutions using _IEFormElementGetCollection and _IEFormSubmit that didn't seem to work. I suspect I am doing something wrong. Any help would be greatly appreciated! Thank you! The DOM: <div class="login ng-scope" ng-class="{'processing-login-request': login.processingLoginRequest}"> <div class="decoration-plant"></div> <div class="decoration-keyfob"></div> <div class="login-container"> <div class="login-heading" ng-init="login.setTextResources({"ButtonOk":"ok","ButtonTryAgain":"try again","MessageResetPasswordSuccess":"Check your email. We’ve sent you instructions for resetting your password.","MessageResetPasswordFailure":"We couldn't process your request. Please check your internet connection and try again in a few moments."})"><!-- ngIf: !login.wasLoginChallenged --> <div class="heading-title ng-scope" ng-if="!login.wasLoginChallenged"> <span class="logo"></span></div> <!-- end ngIf: !login.wasLoginChallenged --><!-- ngIf: ssLogoutDueToInactivity --></div> <!-- ngIf: !login.showResetPassword && !login.wasLoginChallenged --> <div class="login-box login ng-scope" ng-if="!login.showResetPassword && !login.wasLoginChallenged"><!-- ngIf: !ssLogoutDueToInactivity --> <div class="login-title ng-scope" ng-if="!ssLogoutDueToInactivity">Log In</div> <!-- end ngIf: !ssLogoutDueToInactivity --> <div class="login-entry"><input name="email" class="email ng-pristine ng-untouched ng-valid ng-empty ng-valid-email" aria-invalid="false" type="email" placeholder="email" ng-keyup="$event.keyCode === 13 ? login.login() : null" ng-model="login.username"></div> <div class="login-entry"><input name="password" class="password ng-pristine ng-untouched ng-valid ng-empty" aria-invalid="false" type="password" placeholder="password" ng-keyup="$event.keyCode === 13 ? login.login() : null" ng-model="login.password"></div> <!-- ngIf: login.wasLoginError --> <!-- ngIf: login.wasLoginErrorBruteForce --> <div class="login-link forgot"><span tabindex="0" class="ss-inline-text-action" role="button" ng-click="login.showResetPassword = true">Forgot your password?</span></div> <div class="login-entry" ng-class="{'processing-login-request': login.processingLoginRequest}"><button class="ss-standard-button" type="button" ng-click="login.login()">log in</button></div> <div class="login-link register"><div tabindex="0" class="ss-inline-text-action new-user" role="button" ng-click="login.navigateToRegister()">New user? Register here.</div> </div> </div> <!-- end ngIf: !login.showResetPassword && !login.wasLoginChallenged --> <!-- ngIf: login.showResetPassword --> <!-- ngIf: login.wasLoginChallenged --> </div> </div> My AutoIt Script: Func SignIn() Global $oIE = _IECreate("XXXXXXX"); login page Local $username = _IEGetObjByName ($oIE, "email");sets the variable to the input name on the page (F12, DOM) Local $password = _IEGetObjByName ($oIE, "password");sets the variable to the input name on the page (F12, DOM) Local $submit = _IEGetObjByName ($oIE, "log in");sets the variable to the input name on the page (F12, DOM) _IEFormElementSetValue ($username, "XXXXXXX");Put your username here between the quotes. This will then send what you've set to the variable input name set above. _IEFormElementSetValue ($password, "XXXXXXX");Put your password here between the quotes. This will then send what you've set to the variable input name set above. _IEAction ($submit, "click"); clicks the input 'op' we set as $submit above EndFunc
Nine Posted February 6, 2020 Posted February 6, 2020 Try this : Local $cButtons = _IETagNameGetCollection ($oIE, "button") For $oButton in $cButtons If $oButton.innerText = "log in" Then _IEAction ($oButton, "click") _IELoadWait ($oIE) ExitLoop EndIf Next “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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