Andree0505 Posted February 1, 2017 Posted February 1, 2017 Hi, I am kind of new here. there is a website i like to automate, the browser remenbers the login but i like to have a auto click. i was searching for a while now to get this problem done, but nothing.. is there somebody who can help me? I have here the script: #include <IE.au3> Global $oIE = _IECreate ("https://vrgroningen.ag5.com/") $oFound = "" Local $oInputs = _IETagNameGetCollection($oIE, "input") For $oInput In $oInputs If String($oInput.classname) = "wt-button login-button cta cta-primary wt-enabled wt-imageless" Then $oFound = $oInputs EndIf Next If IsObj($oFound) Then _IEAction ($oFound, "click") MsgBox(16, "Success", "Password23 with a captial P (Roles have been set)") Else MsgBox(16, "Failed", "Not found.") EndIf Also the webcode: <li class="wt-panel-item wt-align-none login-button-outer" style="width: 100%;"> <input class="wt-button login-button cta cta-primary wt-enabled wt-imageless" type="submit" value="Inloggen"> </li> complete webcode attached. website.txt
water Posted February 1, 2017 Posted February 1, 2017 Welcome to AutoIt and the forum! You need to do some error checking after each _IE* function call. Something like this: Local $oInputs = _IETagNameGetCollection($oIE, "input") If @error Then Exit MsgBox(0, "Error", "Error searching for input elements! @error = " & @error & ", @extended = " & @extended) My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Danp2 Posted February 1, 2017 Posted February 1, 2017 $oFound = $oInputs I believe this should actually be $oFound = $oInput However, a better solution would be to use _IEFormSubmit -- $oForm = _IEFormGetCollection($oIE, 0) _IEFormSubmit($oForm) Latest Webdriver UDF Release Webdriver Wiki FAQs
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