How to click THIS Login button

6 posts in this topic

#1 ·  Posted

At this site there is a Login button at the top, how do I click this? I can set the fields for username and password but everything I've tried to click Login does not work.

I don't really want to have to do a pixelsearch and move the mouse to click the button.

Share this post

Link to post
Share on other sites

#2 ·  Posted

depends which browser you are using, you can use ff, chrome, ie udf .

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post

Link to post
Share on other sites

#3 ·  Posted

#include <IE.au3>

Global $link = ''

Local $oIE = _IECreate($link)

$tags = $oIE.document.GetElementsByTagName("button")

For $tag in $tags
$class_value = $tag.GetAttribute("class")
If string($class_value) = "btn btn-info" Then

    $oCorrectObj = $tag
    If $oCorrectObj.parentElement.parentElement.parentElement.GetAttribute("class") == "pull-right user-module visible-sm visible-xs  " Then


Share this post

Link to post
Share on other sites

#4 ·  Posted

Have you tried _IEFormSubmit?


Share this post

Link to post
Share on other sites

#5 ·  Posted

Hi everyone,

Thanks for all responding so quickly - Muhammad I shall try your example in a moment, I don't think I'd ever have worked that out, thank-you!

Sorry 232showtime I did put ie as a tag but should have been more explicit.

AutoBert - yes I did, I had something similar to what Muhammad has posted that was failing and I had tried FormSubmit but it wasn't recognising the form object.

Just when I think I'm getting competent with AutoIt something that should be simple comes and stumps me! Such is life.

Share this post

Link to post
Share on other sites

#6 ·  Posted

Ok so the solution from Muhammad didn't directly work, but it revealed that the site is based on WordPress (I should have noticed this from the source) so it took me to the WP login page which fortunately was easier to interact with.

Thank-you all!

1 person likes this

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

  • Similar Content

    • Juvigy
      IE automation
      By Juvigy
      Hi Guys,
      I have a very complex IE page with lots of Java and Iframes. I need to be able to look for a change in one <input> field. So what i have done is to identify the field and hook an event listener with ObjEvent($title, "_Evt_")  and then i use :
      Func _Evt_OnChange() Local $o_object = @COM_EventObj ConsoleWrite( "Change" & $o_object.value &@CRLF) _FileWriteLine($MainLog, "Change:" & _NOW()) TitleCheck($o_object.value) EndFunc Which work fine user doesn't interact with some of the other buttons or radios on the page. As soon as the user does some interaction or refreshes the page or navigates - the event listener is 'deleted' somehow and no longer works. Any idea how to counteract that? The easiest this is to detect if there is ANY change on the page - then i can identify the INPUT and check for its value. Any idea how to do that ?
    • Dent
      How do I write to this form in IE?
      By Dent
      This is the page with the form I'm trying to write to Tennis Odds Calculator
      Username : dent
      Password : autoit
      Here's my full code:-
      #include <IE.au3> Local $TOCUsername = "dent" Local $TOCPassword = "autoit" Local $oIE = _IECreate("") If Not IsObj($oIE) Then Exit ConsoleWrite("Error creating instance of IE" & @CRLF) Local $oIE = _IEAttach("TOC") _IELoadWait($oIE) _IENavigate($oIE, "") _IELoadWait($oIE) Local $Page = _IEBodyReadText($oIE) If StringInStr($Page, "Username or Email") Then Local $oUsername = _IEGetObjByName($oIE, "username") _IEFormElementSetValue($oUsername, $TOCUsername) Local $oPassword = _IEGetObjByName($oIE, "password") _IEFormElementSetValue($oPassword, $TOCPassword) Local $oClassReturn = $oIE.document.getElementsByClassName("form-actions") If Not IsObj($oClassReturn) Then Exit ConsoleWrite("Error in $oClassReturn" & @CRLF) Local $oTagReturn = $oClassReturn.Item(0).getElementsByTagName("button") If Not IsObj($oTagReturn) Then Exit ConsoleWrite("Error in $oTagReturn" & @CRLF) $oTagReturn.Item(0).Click() _IELoadWait($oIE) ElseIf StringInStr($Page, "Use the menu at the top") Then _IENavigate($oIE, "") _IELoadWait($oIE) Else MsgBox(0, "Error", "Unknown error") EndIf Sleep(2000) Local $oForm = _IEFormGetObjByName($oIE, "form") Local $sFirstServePc1 = "55.7" Local $sFirstServePc2 = "54.9" Local $sFirstServeWonPc1 = "60.0" Local $sFirstServeWonPc2 = "54.6" Local $sSecondServeWonPc1 = 72.4" Local $sSecondServeWonPc2 = "61.0" Local $sBPSavePc1 = "78.0" Local $sBPSavePc2 = "68.8" Local $oPlayer1FSPC = _IEFormElementGetObjByName($oForm, "fs") $oPlayer1FSPC.Value = $sFirstServePc1 Local $oPlayer2FSPC = _IEFormElementGetObjByName($oForm, "ofs") $oPlayer2FSPC.Value = $sFirstServePc2 Local $oPlayer1FSWPC = _IEFormElementGetObjByName($oForm, "fsw") $oPlayer1FSWPC.Value = $sFirstServeWonPc1 Local $oPlayer2FSWPC = _IEFormElementGetObjByName($oForm, "ofsw") $oPlayer2FSWPC.Value = $sFirstServeWonPc2 Local $oPlayer1SSWPC = _IEFormElementGetObjByName($oForm, "ssw") $oPlayer1SSWPC.Value = $sSecondServeWonPc1 Local $oPlayer2SSWPC = _IEFormElementGetObjByName($oForm, "ossw") $oPlayer2SSWPC.Value = $sSecondServeWonPc2 Local $oPlayer1BPS = _IEFormElementGetObjByName($oForm, "kps") $oPlayer1BPS.Value = $sBPSavePc1 Local $oPlayer2BPS = _IEFormElementGetObjByName($oForm, "kpb") $oPlayer2BPS.Value = $sBPSavePc2  
    • Dent
      [SOLVED] Possibly used before declaration error in IE.au3
      By Dent
      Hi all,
      So I have a script that interacts with IE but for some reason I can't identify I'm getting the 'possibly used before declaration' error even though I've declared and used those variables.
      Local $oPlayer1FSPC = _IEGetObjByName($oIE, "fs") $oPlayer1FSPC.Value = $sFirstServePc1 Local $oPlayer2FSPC = _IEGetObjByName($oIE, "ofs") $oPlayer2FSPC.Value = $sFirstServePc2 Local $oPlayer1FSWPC = _IEGetObjByName($oIE, "fsw") $oPlayer1FSWPC.Value = $sFirstServeWonPc1 Local $oPlayer2FSWPC = _IEGetObjByName($oIE, "ofsw") $oPlayer2FSWPC.Value = $sFirstServeWonPc2 Local $oPlayer1SSWPC = _IEGetObjByName($oIE, "ssw") $oPlayer1SSWPC.Value = $sSecondServeWonPc1 Local $oPlayer2SSWPC = _IEGetObjByName($oIE, "ossw") $oPlayer2SSWPC.Value = $sSecondServeWonPc2 Local $oPlayer1BPS = _IEGetObjByName($oIE, "kps") $oPlayer1BPS.Value = $sBPSavePc1 Local $oPlayer2BPS = _IEGetObjByName($oIE, "kpb") $oPlayer2BPS.Value = $sBPSavePc2 The $s variables have had strings assigned earlier in the script and I've tested that with ConsoleWrite
    • TimothyGirard
      Can't read style element
      By TimothyGirard
      I'm trying to create an autoPop tool for AliExpress. When I get to their address page, there are a number of input fields. There are also two drop downs. One is for the country and, depending on what you select, the other dropdown appears with city names or, a standard input box is visible to add a city (See the images). So if I select "United States" the other dropdown is visible with all the states. If I select "France", the input box is visible to enter a French city. Seems cool enough but I'm really struggling trying to get this to work.
      This is my test code to work all this out:
      #include <MsgBoxConstants.au3> #include <IE.au3> Local $StartPos Local $oIE = _IECreate("") If @error Then Exit MsgBox(16, "openURL Error", @CRLF & "@error = " & @error & ", @extended = " & @extended) ;If $bVerbose == true Then MsgBox(0, "openURL", "IECreate Object Created") ;Get the Collections $oInputs = _IETagNameGetCollection($oIE, "input"); Input Fields $oSelects = _IETagNameGetCollection($oIE, "select"); Select Fields ;Loop through the Selects For $oSelect In $oSelects If $ = "country" Then _IEFormElementOptionSelect($oSelect, "France", 1, "byText",1) Next ;Loop through the inputs For $oInput In $oInputs If $ = "email" Then $oInput.Value = "" If $ = "contactPerson" Then $oInput.Value = "My Full Name" If $ = "address" Then $oInput.Value = "123 Anystreet" If $ = "address2" Then $oInput.Value = "NA" If $ = "province" Then MsgBox(0, "","$ = " & $ &@CRLF &"$ = " & $ &@CRLF &"$oInput.type = " & $oInput.type&@CRLF &"$oInput.maxLength = " & $oInput.maxlength) $oInput.Value = "FrenchyLand" EndIf If $ = "city" Then $oInput.Value = "AnyTown" If $ = "zip" Then $oInput.Value = "12345" If $ = "mobileNo" Then $oInput.Value = "1-415-555-1212" Next So I open the page on AliExpress and get an   "input" collection and a "select" Collection
      I first loop through the Selects until I find "country" and then select "France"
      I then loop through all the inputs and put the information in the correct inputs.
      When the country is one that AliExpress knows the states or provinces for,  they swap Styles between the input box and the dropdown  to either "display: inline-block;" or "display: none;" which hides one, or the other (See the AliExpDOM Image).
      Problem #1: When I use the "_IEFormElementOptionSelect($oSelect, "France", 1, "byText",1)" To make the dropdown selection, It selects it but does not invoke the widget to change the second dropdown to an input box.
      Problem #2: I thought a possible solution would be to read the Style of the input box and based on the value, either place text in the input box or go to the dropdown and make a selection. I can't seem to read the Style attribute from the collection ie: $ returns nothing.
      Any help here would be greatly appreciated. If I figure out a solution before and answer here, I will publish it here for anyone else who might be struggling with these kinds of things

    • ruslanas402
      Stucks after "File to upload" window
      By ruslanas402
      Greeting, so I've been trying to come up with solution, but no luck. Despite I tried to automate upload function, I released that it freezes after "Choose File to Upload" window appears..
      #include <IE.au3> ;#include <_Dbug.au3> Global $oIE = _IECreate("", 1) Global $upload2 = _IEGetObjById($oIE, "the_file") _IEAction($upload2, "click") ;Sleep(1000) $hWnd = WinGetHandle("Choose File to Upload") MsgBox(0, "", $hWnd) Have anybody faced this situation?
      btw: srry for the advertise Besides it's no matter which site I'm trying to do this it's all the same.