Sign in to follow this  
Followers 0
tommytx

DOM Stuff

5 posts in this topic

<

$hog = _IETagNameGetCollection ($oIE, "button")

For $x In $hog

Msgbox(0, "", $x.name)

Next

>

This loop finds two buttons with names on the page.

Button 1 and Button 2... I seem to be missing something, how can I capture the second button name as I have tried the following code...

$y = $hog[0].name

$z = $hog[1].name

This is the variable I want..

I must be formatting it wrong... as the loop above displays what I am looking for, and I want to capture the second one in the variable $z but it does not work... what have I done wrong?

When the for loop above runs it displays the name of the two buttons... perfectly...

But I cannot seem to capture them. The links I am using throw an error.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

_IEFormElementGetObjByName()?

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Thanks for the suggestion, but the name changes on every load so I do not have the name, I have to wait for to load to find out what it is..

However I find this works but is cumbersome.

$hog = _IETagNameGetCollection ($oIE, "button")

For $x In $hog

$dat = $x.name

Next

msgbox(0,"",$dat)

So what happens is when the loop finished $dat end up with the last variable in the iteration and that works fine, but only because the last one [0], [1] of the two items is the one I want so its still in $dat and I can use it ok, but what I really need is the format to grab it without the loop..

its something like $dat = $hog[1].name or $hog.name[1] but they don't seem to work.

Can anyone see my error?

Share this post


Link to post
Share on other sites

$oButton1 = _IETagNameGetCollection ($oIE, "button", 0)

$oButton2 = _IETagNameGetCollection ($oIE, "button", 1)

ConsoleWrite("Button1: " & $oButton1.name & @CRLF)

ConsoleWrite("Button2: " & $oButton2.name & @CRLF)

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

that is fantastic Dale... thank you...

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