Jump to content
Sign in to follow this  

Object Identification

Recommended Posts

I'm trying to figure out the best way to make use of COM/OLE programming and it seems like the most

confusing aspect is how to identify a program's objects. For instance, in the code for one of the examples:

#include <IE.au3>

$oIE = _IECreate ("http://sourceforge.net", 0, 0)

; Display the innerText on an element on the page with a name of "sfmarquee"

$oMarquee = _IEGetObjByName ($oIE, "sfmarquee")

MsgBox(0, "SourceForge Information", $oMarquee.innerText)

_IEQuit ($oIE)

The object named "sfmarquee" is identified on the sourceforge.net page. How do you get the names or other identifying info about the numerous objects on a webpage. I also work alot with custom office software

for various businesses and I would like to figure out a way to identify the objects on these (non web-based) programs as well.

Any help or a nudge in the right direction would be greatly appreciated.


Share this post

Link to post
Share on other sites

There is really no substitute for being able to read and understand the HTML source. One thing to know is that NAME= and ID= attributes of tags share the same namespace (i.e. are used interchangably).

There are things that make this easier than visually parsing the entire HTML source however: 1) I wrote some scripts that Valuator incorporated into his IE Builder script that will show you a lot of information about the HTML page, including tag names and id's (search the forum for it) 2) you can use the Firefox builtin DOM Inspector, 3) you can use the IE Developer Toolbar (google for it) and 4) there are several others, one I like is MODIV2 (mouse-over DOM Inspector V2 - again, Google for it).


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

Thanks very much. I'll give all those methods a try. I knew there had to be something easier than going through 500 lines of html.....

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...