Jump to content

_IE Click Button without Name or ID?

Recommended Posts

If you press the "Login" button in the top-left of https://www.showroom-live.com/, it creates a popup in which you press "Login with Twitter ID", which then opens a new window with an "Authorize app" button.

None of these 3 buttons have a Name or ID, so how do I click on them, because _IEGetObjByName / _IEGetObjByID will not work.

Here are the sources of the 3 buttons:

;Login button.
   ;<a onclick="showLoginDialog();" href="javascript:void(0);">Login</a>

   ;Twitter button (Note that I am already signed into Twitter and just need to Authorize it).
   ;<a class="btn-twitter btn-sky-blue submit fs-b5" onclick="window.open('/social/twitter/redirect_authorize_url?login=1&from_browser=1', 'twitter', 'width=500,height=400,menubar=yes,status=yes,scrollbars=yes');" href="javascript:void(0);">Login with Twitter ID</a>

   ;Popup window appears.
   ;<input class="submit button selected" id="allow" type="submit" value="Authorize app">

I have also tried:

Local $oLinks = _IETagNameGetCollection($ie, "a")
For $oLink In $oLinks
   If $oLink.InnerText = "showLoginDialog()" Then
      _IEAction($oLink, "Click")

I've even tried adding "showLoginDialog()" and "javascript:void(0)" to the end of the URL, but as expected, that wouldn't work either.

My goal is something like this:

#include <IE.au3>

Local $ie = _IECreate("https://www.showroom-live.com/onlive")

Local $originalHandle = $ie

Func login()
   ;Source: <a onclick="showLoginDialog();" href="javascript:void(0);">Login</a>
   _IEAction(ABOVESOURCE, "Click")
   ;Source: <a class="btn-twitter btn-sky-blue submit fs-b5" onclick="window.open('/social/twitter/redirect_authorize_url?login=1&amp;from_browser=1', 'twitter', 'width=500,height=400,menubar=yes,status=yes,scrollbars=yes');" href="javascript:void(0);">Login with Twitter ID</a>
   _IEAction(ABOVESOURCE, "Click")

   ;New window appears for Twitter sign in, but the URL is locked.
   ;Source: <input class="submit button selected" id="allow" type="submit" value="Authorize app">
   _IEAttach($ie, ABOVEHANDLE) ;How do I get the handle of the new window from above?
   _IEAction(ABOVESOURCE, "Click")
   _IEAttach($ie, $originalHandle)



Thank you in advance.

Edited by IAMK
Link to post
Share on other sites

Maybe something more like, not tested.

If StringInstr($oLink.ClassName, "showLoginDialog") <> 0 Then

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By faustf
      hi guys how is possible set a speed of  all function _Ie ?? 
    • By ChipConnJohn
      Hello all,
      I'm trying to create a webscrape script using AutoIt.  A non-profit I'm involved with is using GroupSpaces.com and there is no notification to the group when someone posts a new topic to the forum.  I'm including IE.au3

      #include <MsgBoxConstants.au3>
      #include <Array.au3>
      #include <String.au3>
      ; Open Groupspaces.com
      Global $oIE = _IECreate ("http://www.groupspaces.com")
      ;Grab all the links on the Forum page
      Global $oLinksCategoryPage = _IELinkGetCollection($oIE)
      For $oLink In $oLinksCategoryPage
          Local $oLinkHRef = $oLink.href
          If StringInStr($oLinkHRef,"forum_id") Then
              ;This is a category. Click into it.
              ;Back out to Category List
    • By AutoBert
      I have a NDIS based Internet sharing device. I got info about my balance inquiry by clicking a button, it's sending ussd *101# to my provider. This was ok in past but no i have changed provider, all other functions are ok, but new provider uses *100# as valid ussd for geting balance inquiry. So i used 
      #include <IE.au3> $oIE=_IECreate('') $sHTML=_IEDocReadHTML($oIE) $sHTML=StringReplace($sHTML,'101#','100#') _IEDocWriteHTML($oIE,$sHTML) to get it. But with this script i can't get the info. It replaces correct in 
      <div id="fun_balanceInquiry" style="display: block;"> <div class="ussd_extend_border"><p><label id="balance_inquiry_description0">Auf Guthaben drücken, um Informationen über Ihr Guthaben zu erhalten.</label></p> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tbody><tr><td height="40" class="cls_ussd_label_BalanceInquiry_action"> <label id="balance_inquiry_result0"></label></td> <td class="align_right" id="balance_inquiry_action0"><span class="button_wrapper" id="#BalanceInquiry0" onclick="javascript:ussd_sendCommand('BalanceInquiry0','*101#','CodeType', 'undefined');return false;"><span class="button_left"><span class="button_right"><span class="button_center">Guthaben</span></span></span></span></td> </tr></tbody></table></div></div> <div id="fun_charge" style="display: none;"> </div> but it seems this included script:
      <script src="../js/ussd.js" type="text/javascript"></script> is called. In DOM Explorer i see:
      function onclick(event) { javascript:ussd_sendCommand('BalanceInquiry0','*101#','CodeType', 'undefined');return false; } but i can't write a changed ussd.js back to my internet stick.
      So my question is how can i change htmlcode in a way calling function onclick with new ussd command?  
    • By avidovi
      Hello Friends,
      I need your advise automating Facebook search project.
      I need to enter a string in a search input box, the inspect element shows me this code:
      <input name="query" class="inputtext" aria-required="true" aria-label="Search" required="1" type="text" maxlength="100" placeholder="Search this group" value="" autocomplete="off">How to treat it? as a form? as an IE object?
      Really appreciating your help.

    • By AnakondaSK
      Hello guys,
      I want script that locate text box on webpage and write text in it, problem is that, that website is changing their ID of text boxes.
      The last few digits of ID(highlighted yellow one) is changing every single time, so i would like to ask if there is way how to solve this. /// It is possible to use only part of ID to localize the text box ?
  • Create New...