Jump to content

How to click button no id or name IE.au3


Recommended Posts

Hi
I want to click on a button that does not have an ID or name, so I would like you to help me with thanks

code: 


<button type="button" class="btn btn-success" data-toggle="modal" data-target="#sharesmodal"><i class="fa fa-forward"></i> Use</button>

Link to comment
Share on other sites

2 minutes ago, Subz said:

Maybe something like:

Local $oButtons = _IETagNameAllGetCollection($oIE, "button")
If IsObj($oButtons) Then
    For $oButton In $oButtons
        If $oButton.className = "btn btn-success" Then
            _IEAction($oButton, "click")
            ExitLoop
        EndIf
    Next
EndIf

 

not working :( please help me

 

#include <IE.au3>
Local $oIE = _IECreate("https://viptools.es/")

Local $oButtons = _IETagNameAllGetCollection($oIE, "button")
If IsObj($oButtons) Then
    For $oButton In $oButtons
        If $oButton.className = "btn btn-success" Then
            _IEAction($oButton, "click")
            ExitLoop
        EndIf
    Next
EndIf

Link to comment
Share on other sites

Try:

#include <IE.au3>
Local $oIE = _IECreate("https://viptools.es", 1)
_IELoadWait($oIE)
Local $oButtons = _IETagNameGetCollection($oIE, "button")
If IsObj($oButtons) Then
    For $oButton In $oButtons
        If $oButton.getAttribute("data-target") = "#sharesmodal" Then
            _IEAction($oButton, "click")
            ExitLoop
        EndIf
    Next
EndIf

 

Link to comment
Share on other sites

1 hour ago, Subz said:

Try:

#include <IE.au3>
Local $oIE = _IECreate("https://viptools.es", 1)
_IELoadWait($oIE)
Local $oButtons = _IETagNameGetCollection($oIE, "button")
If IsObj($oButtons) Then
    For $oButton In $oButtons
        If $oButton.getAttribute("data-target") = "#sharesmodal" Then
            _IEAction($oButton, "click")
            ExitLoop
        EndIf
    Next
EndIf

 

thanks you ♥ love

Link to comment
Share on other sites

1 hour ago, Subz said:

Try:

#include <IE.au3>
Local $oIE = _IECreate("https://viptools.es", 1)
_IELoadWait($oIE)
Local $oButtons = _IETagNameGetCollection($oIE, "button")
If IsObj($oButtons) Then
    For $oButton In $oButtons
        If $oButton.getAttribute("data-target") = "#sharesmodal" Then
            _IEAction($oButton, "click")
            ExitLoop
        EndIf
    Next
EndIf

 

Well, let me ask how to get ElementSetValue

<input type = "text" class = "form-control" name = "118b8c9e3a2da6d" style = "text-align: center; font-weight: bold;" placeholder = "Username" aria-label = "Username" aria-describedby = "basic-addon1" required = "">

Link to comment
Share on other sites

14 minutes ago, HADE said:

Well, let me ask how to get ElementSetValue

<input type = "text" class = "form-control" name = "118b8c9e3a2da6d" style = "text-align: center; font-weight: bold;" placeholder = "Username" aria-label = "Username" aria-describedby = "basic-addon1" required = "">

Can you please re-state your question in different words? *A screenshot would help a lot (of the browser inspect element)*

Link to comment
Share on other sites

3 minutes ago, rm4453 said:

Bạn có thể vui lòng nêu lại câu hỏi của bạn bằng các từ khác nhau? * Ảnh chụp màn hình sẽ giúp ích rất nhiều (của yếu tố kiểm tra trình duyệt) *

hee

image.thumb.png.56983110e91e2e3c26caae801a15eb15.pngh

Link to comment
Share on other sites

3 minutes ago, rm4453 said:

Bạn có thể vui lòng nêu lại câu hỏi của bạn bằng các từ khác nhau? * Ảnh chụp màn hình sẽ giúp ích rất nhiều (của yếu tố kiểm tra trình duyệt) *

hope you help me

Link to comment
Share on other sites

$userField = _IEGetObjByName($oIE, "af39cb3d1c784") ; "af39cb3d1c784" is the name of the username field
_IEFormElementSetValue($userField, "hade1274") ; "hade1274" is your username

 

Edited by rm4453
commented code
Link to comment
Share on other sites

4 minutes ago, rm4453 said:
$userField = _IEGetObjByName($oIE, "af39cb3d1c784") ; "af39cb3d1c784" is the name of the username field
_IEFormElementSetValue($userField, "hade1274") ; "hade1274" is your username

 

not working :( please help me

#include <IE.au3>

Local $oIE = _IECreate("https://viptools.es", 1)
_IELoadWait($oIE)
Local $oButtons = _IETagNameGetCollection($oIE, "button")
If IsObj($oButtons) Then
    For $oButton In $oButtons
        If $oButton.getAttribute("data-target") = "#tiktokFollowers" Then
            _IEAction($oButton, "click")
            ExitLoop
        EndIf
    Next
 EndIf


   $userField = _IEGetObjByName($oIE, "62896125e9c95c") ; "af39cb3d1c784" is the name of the username field
_IEFormElementSetValue($userField, "hade1274") ; "hade1274" is your username

Local $oElements = _IETagNameAllGetCollection($oIE)
For $oElement In $oElements
    If $oElement.classname = 'disableButton btn btn-success' Then  $oElement.click()
Next

Link to comment
Share on other sites

1 minute ago, HADE said:

 

 

Please Use Code Tags Like Below:

 

#include <IE.au3>

Local $oIE = _IECreate("https://viptools.es", 1)
_IELoadWait($oIE)
Local $oButtons = _IETagNameGetCollection($oIE, "button")
If IsObj($oButtons) Then
    For $oButton In $oButtons
        If $oButton.getAttribute("data-target") = "#tiktokFollowers" Then
            _IEAction($oButton, "click")
            ExitLoop
        EndIf
    Next
 EndIf


   $userField = _IEGetObjByName($oIE, "62896125e9c95c") ; "af39cb3d1c784" is the name of the username field
_IEFormElementSetValue($userField, "hade1274") ; "hade1274" is your username

Local $oElements = _IETagNameAllGetCollection($oIE)
For $oElement In $oElements
    If $oElement.classname = 'disableButton btn btn-success' Then  $oElement.click()
Next

 

Link to comment
Share on other sites

;===CREDIT===========================
;
; URL TO SOURCE: https://www.autoitscript.com/forum/topic/136542-ie-automation-get-all-input-fields-and-set-values/
; CREDIT FOR CODE TO: Robjong
;
;====================================


#include<IE.au3>


$sURL = "http://yahoo.com"
$oIE = _IECreate($sURL, 0, 1, 1, 1)

$colForms = _IEFormGetCollection($oIE) ; get all forms
For $oForm In $colForms ; loop over form collection

    ConsoleWrite("---- FORM " & $oForm.name & " --------------------" & @CRLF)
    $oFormElements = _IEFormElementGetCollection($oForm) ; get all elements
    For $oFormElement In $oFormElements ; loop over element collection

        If StringLower($oFormElement.tagName) == 'input' Then ; it is an input
            ConsoleWrite("> input." & $oFormElement.type & " " & $oFormElement.name & @CRLF)
            _IEFormElementSetValue($oFormElement, "Found You", 0) ; set value of the field
        ElseIf StringLower($oFormElement.tagName) == 'textarea' Then ; it is a textarea
            ConsoleWrite("> textarea " & $oFormElement.name & @CRLF)
            _IEFormElementSetValue($oFormElement, "Found You", 0) ; set value of the field
        EndIf

    Next

Next

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...