Jump to content

_IETagNameGetCollection


Recommended Posts

Hi everyone,

I'm having trouble getting reference to a button, im not sure which part of

<input class="change-confirm-button id-button-yes green_btn_big" type="button"value="yes" ></input>

I'm meant to include and which parametre to include it in

am I using the correct IE fuct?

I want my script to run then click _IEaction perhaps focus and then click this button

so i want any propertie of the button that can be recognizes then have those commands sent to it

there is also

<input class="change-confirm-button id-button-no grey_btn_big" type="button"value="no" ></input>

but if i reference to the button i only want it to click the "yes" button

can i get the input class and then reference it to just the yes ? and if so how do i make it recognize

the yes?

contained in <div class="id-container-buttons"

I tryed playing around with _IEgetobjbyname and such, but im not sure there's even a name present

Link to comment
Share on other sites

A small example is better than a long speech...

#include <IE.au3>

$oIE = _IECreate("http://www.autoitscript.com/wiki/Main_Page")
Sleep(1000)
Local $oInputs = _IETagNameGetCollection($oIE, "input")
For $oInput In $oInputs
If $oInput.value == "Go" Then
_IEAction($oInput, "click")
Exitloop
EndIf
Next

all code is executing without error, but still no result in mouseclick should i try @error before mouseclick to see if it is actually achieving gathering the input, would that work?

my script works on the basis that they are already on the page they're about to start the script on, incase window is minimized there is a winactivation func in place so is that achieving the same as _IEcreate in a sense that the page is already there.

I tryed with the window existing then activating. so with ie create it creates another window with enough time to load and still no result without winactivate

Link to comment
Share on other sites

I found this example which seems to work with the classname, i first tested it with my links and div class and got

msgbox then i found in ur suggestion mike we had $oinput for "input" so i guess the o was stopping it? should we have had just $input? would the variable automatically take on that value? or maybe just the value; yes? im not sure, as im still learning i wasn't quite aware of these little things yet

so i changed that then tryed with what u said trying the value, but recieved no messagebox... i also tryed .valueNAME"yes" wether or not that is a legit thing i dont know but worth a try. anyway it couldnt read that either

so then i tryed the $input.classname and managed to get that.

i guess now ill replace msgbox with a click and see if it works

apologies to everyone, i dont know much yet, but i learned a bit today, sorry for poor coding

#include

$oIE = _IECreate("") ; place ie link within.
sleep (14000)
$divs = _IETagNameGetCollection($oIE, "div")

For $div In $divs
If $div.className == "id-container-buttons" Then
MsgBox(0, "suceed", $div.innerText); should be input box not msgbox, msgbox can't input value?
EndIf
Next

_IEQuit($oIE)
Edited by cookiekiller89
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...