Jump to content
Sign in to follow this  
MJ36

How to click button like

Recommended Posts

image.thumb.png.a3ca4ddd5775365af67ff444c6886bd3.png

How to click this button ? 

I Try 

 

func test ()
    $oCorrectObj = ""

$tags = $oIE.document.GetElementsByTagName("button")
For $tag in $tags
$class_value = $tag.GetAttribute("type")
If string($class_value) = "buttont" Then
    $oCorrectObj = $tag

MsgBox(0, "Level: ", "Level found :)")

Else
    MsgBox(16, "Failed", "Not found.")

    ExitLoop

EndIf
Next

If IsObj ( $oCorrectObj ) Then

_IEAction ($oCorrectObj, "click")


EndIF

 

and

 

func klik ()

    Local $oFound = ""
Local $oBtns = _IETagNameGetCollection($oIE, "span")
For $oBtn In $oBtns
    If String($oBtn.classname) = "yt-uix-button-content" Then
        $oFound = $oBtn
        EndIf
Next

_IEAction ($oFound, "click")




EndFunc

 

Please Help 

Can you click it by name?

Share this post


Link to post
Share on other sites

If would change your _IETagNameGetCollection line to --

Local $oBtns = _IETagNameGetCollection($oIE, "button")

You would then need to loop through the collection to find the correct button.

Even better, you could limit the results by passing the containing div element instead of $oIE --

Local $oDiv = _IEGetObjById($oIE, "watch7-views-info")
Local $oBtns = _IETagNameGetCollection($oDiv, "button")

If there only one button or you know the index, you could do something like this --

Local $oDiv = _IEGetObjById($oIE, "watch7-views-info")
Local $oBtn = _IETagNameGetCollection($oDiv, "button", 0)
_IEAction ($oBtn, "click")

 

Share this post


Link to post
Share on other sites

it makes sense, it starts to brighten up :)
what if I have a few buttons there

 

image.png.3662fecb530c2adadd9a0a0a64e0bf98.png

 

Additional question
possibly if I can find a button by name in some way. Such knowledge would be useful in the future :) For example, I mean identification after this

image.png.0b85d30a7a4487d37e029d4d7602df76.png

 

 

 

 

Edited by MJ36

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
Sign in to follow this  

  • Similar Content

    • By v120
      Rapid Fire Mouse Hack Script
      *snip*
       
    • By nooneclose
      Good morning, I am trying to figure out if it is possible to check if these invoice lines exist or not. 
      Here are the table and column name: INVOICELINE.INVOICELINENUM (a required field if created)
      Here is a picture of what I am talking about. (Do not worry about security. the picture is from a demo test site so all information is fake)
       
      is there any way to check if these fields exist or not? (they do not exist unless the user clicks on "New Row")
      Example: line 11 does not exist right now. How would I go about to see if it did or not? 
      This is what I have so far:
      SELECT DISTINCT iv.invoicenum, iv.description FROM invoice AS iv JOIN invoiceline AS ivl ON iv.invoicenum = ivl.invoicenum AND iv.siteid = ivl.siteid /* = 'nothing' and yet somehow not null? */ WHERE iv.invoicenum NOT IN (SELECT invoicelinenum FROM invoiceline WHERE invoicelinenum IS NOT NULL) I get 0 results where I should get more than 0. 
    • By Kruxe
      Hello Everyone,
      I am very green when it comes to AutoIT, I have recently started using it to automate a job that i perform using MS Excel and that is working great. Recently I have been faced with a challenge I which i need to copy a specific set of lines from one .txt file and past them, overwriting a specific set of lines in a different .txt file. I honestly have no clue how I can copy the specified lines and transfer them. What functions / commands could I use and how could I lay them out I AutoIT? Any and all help will be appreciated. 
      Thanks!
      Kruxe
    • By Saravanan2213
      Hi everyone,
      i just need your help. i have script for cleaning browsing history and other unwanted file but the problem is i don't want to see the GUI i have attached below. It should not show anything on the screen. is it possible to do it in autoit. thanks in advance.
       
      So for i have tried flag
      Run("rundll32.exe InetCpl.cpl,ClearMyTracksByProcess 255", "", @SW_HIDE)
      @SW_DISABLE
       
      Looking forward your help.........

    • By cptHark
      Hello I want to conect to a Network with DriveMapAdd.
      This worked just fine but when you restart the Computer the Mapped drive is gone.
      So i used the persistent mapping flag and that seemed to work, too.
      However when the Computer is restarted I cant connect to the Network because it doesnt remember the Username and password I ave it the first time.
      How do I fix this?
      My Code:Func
      setdrivem()
          DriveMapAdd("M:", GUICtrlRead($driveM),1, GUICtrlRead($netzuser),GUICtrlRead($netzpassword) )
      EndFunc
      $netzuser and $netzpassword are set earlier in the gui and it works right after executing the script but i want it to stay connected
×
×
  • Create New...