Sign in to follow this  
Followers 0
Arclite86

Click a button, with _IETagNameGetCollection

10 posts in this topic

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,

Share this post


Link to post
Share on other sites



There are some similiar topics lately, try to search them and you will solved it :)

Share this post


Link to post
Share on other sites

There are some similiar topics lately, try to search them and you will solved it :)

i have tried to search for that but because i am a noob, i dont understand them completely, could you please show me how i can solve this, them i am able to get further.

Share this post


Link to post
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

Share this post


Link to post
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")'')

Share this post


Link to post
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 :)

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

the element is a

Share this post


Link to post
Share on other sites

the element is a

so its always the first word after <     ?

Share this post


Link to post
Share on other sites

yes! :)

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  
Followers 0