Jump to content

Click a button, with _IETagNameGetCollection


Go to solution Solved by michaelslamet,

Recommended Posts

I have to push a two buttons if there are two buttons with the same type, now I have to push a button:

 

button1:
<button type="submit" class="submit btn primary-btn flex-table-btn js-submit">
            Inloggen
          </button>
 
Button2:
registeren ;<button type="submit" class="btn signup-btn">
      Registreren op Twitter
    </button>
 
as you see the both buttons have the same type so i cannot  use:
 
Local $oButs = _IETagNameGetCollection($oIE, "button")
For $oBut In $oButs
    If $oBut.type == "submit" Then _IEAction($oBut, "click")
 
 
 
and i want to uncheck a box
 
 
<input type="checkbox" value="1" name="remember_me">      
 
can somebody give me the solution for this, so i can push these buttons too,
 
Thanks,
Link to comment
Share on other sites

With _IETagNameGetCollection, in the For loop you can use each property of the object and use the one which is unique

i.e. for the checkbox, the name is unique in the page

Local $oInputs = _IETagNameGetCollection($oIE, "input")
For $oInput In $oInputs
    If $oInput.name == "remember_me" Then $oInput.checked = false
Next

and for the button, its text

Local $oButs = _IETagNameGetCollection($oIE, "button")
For $oBut In $oButs
    If StringInStr($oBut.innertext, "Inloggen") Then _IEAction($oBut, "click")
Next
Link to comment
Share on other sites

 

With _IETagNameGetCollection, in the For loop you can use each property of the object and use the one which is unique

i.e. for the checkbox, the name is unique in the page

Local $oInputs = _IETagNameGetCollection($oIE, "input")
For $oInput In $oInputs
    If $oInput.name == "remember_me" Then $oInput.checked = false
Next

and for the button, its text

Local $oButs = _IETagNameGetCollection($oIE, "button")
For $oBut In $oButs
    If StringInStr($oBut.innertext, "Inloggen") Then _IEAction($oBut, "click")
Next

ok last question: how do you know  to put ''button''  (in ''Local $oButs = _IETagNameGetCollection($oIE, "button")'')

Link to comment
Share on other sites

because the element is button as you can see on the source code of the page: <button blabla>

form element is <form blabla>

input is <input blabla>

hope its clear :)

 
 
so if i understand you correctly whats in the < > is the ellement but if you have a large line like this one:
<a class="btn btn_smaller btn_orange inline_block btn_submit_form" 
id="submit_btn" href="#x">Login »</a>
 
what will be the ellement?
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...