Dent

How to click THIS Login button

6 posts in this topic

At this site http://tennisinsight.com/ 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



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
#include <IE.au3>

Global $link = 'http://tennisinsight.com'


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
    $oCorrectObj.click()
    EndIf
EndIf
Next

 

Share this post


Link to post
Share on other sites

Have you tried _IEFormSubmit?

 

Share this post


Link to post
Share on other sites

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

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

    • Gowrisankar
      By Gowrisankar
      Hello everyone,
      When I launch a URL and the webpage takes more time to load (say more than 1 minute), I want the URL to be relaunched.
      I used _IELoadWait(). But the control doesn't get pass through the _IELoadWait() command, since the webpage takes more time to load.
      I searched some of the older posts related to this topic. But I couldn't work them out.
      Please guide me.
    • elbhiri
      By elbhiri
      i have two files a.au3 and b.au3 the both contains the same code which is :
      #include <IE.au3> #include <MsgBoxConstants.au3> Global $myUrl = "https://www.autoitscript.com" RegWrite('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\Main','SessionMerging','REG_DWORD','00000000') ShellExecute ("iexplore.exe", " -nosessionmerging about:blank") WinWait ("Blank Page") Global $oIE = _IEAttach ("about:blank", "url") _IELoadWait ($oIE) _IENavigate ($oIE, $myUrl) when i launch the both files in the same time two blank windows are opens.
      what im waiting for is that every window navigate to the link but what happen is the first and the second file navigate the url to the same window and the seconde window stay about:blank
      i think the problem happen because i try to open the same url in both windows
      so i need i way to navigate to the same url from two different windows
      Thanks in advance
    • HudsonKane
      By HudsonKane
      I have a page with several hundred <div>s, and each <div> has several hundred child <div>s, each with their own children
      when I use _IETagNameGetCollection($ie, "div", 0) I get them all, but I need to find a way to get say the 3rd child of the 5th child of the second top level <div>
      I have not yet been able to find anything along this line
      Is there any way to determine if an element is a child, parent, sibling?
      Thank you
    • mjolnirmarkiv
      By mjolnirmarkiv
      Hi!
      Does anyone have any idea why Test() returns 0, while Test2() returns 1?
      #include <IE.au3> MsgBox(0, "", Test() & " " & Test2()) Func Test() Local $oHTML = ObjCreate("HTMLFILE") $oHTML.body.innerHTML = FileRead("Test.html") Return IsObj($oHTML.getElementsByClassName("example")) EndFunc Func Test2() Local $oIE = _IEAttach("", "instance", 1) Return IsObj($oIE.document.getElementsByClassName("example")) EndFunc Sample Test.html I open in IE before testing:
      <!DOCTYPE html> <html> <body> <p class="example"></p> <div class="example"></div> </body> </html> I'm receiving html text in a response to http request, I need to parse it fast and easy, getElementsByClassName would have been ideal. I'm using 3.3.12.0 version.
    • ADIN
      By ADIN
      When at some page i access by  IE.au3 appears javascript alert all my code stops and i cant do nothing. Is there any way to stop executing javascript at this page or any way to force autoit to click "OK" when this alert appears?
       
      _IENavigate($oIE, "www.example.com") _IELoadWait($oIE) ; site is loaded and alert appears Send("{ENTER}") ;i want to close alert, this command is not executed, whole script is freeze ; cant do nothing more here....