Andree0505

Get input classname not working? click

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites
$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)

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now