Arclite86 Posted January 20, 2014 Posted January 20, 2014 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,
michaelslamet Posted January 20, 2014 Posted January 20, 2014 There are some similiar topics lately, try to search them and you will solved it
Arclite86 Posted January 20, 2014 Author Posted January 20, 2014 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.
mikell Posted January 20, 2014 Posted January 20, 2014 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
Arclite86 Posted January 20, 2014 Author Posted January 20, 2014 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")'')
michaelslamet Posted January 20, 2014 Posted January 20, 2014 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
Arclite86 Posted January 20, 2014 Author Posted January 20, 2014 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?
Arclite86 Posted January 20, 2014 Author Posted January 20, 2014 the element is a so its always the first word after < ?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now