Jump to content
Sign in to follow this  

_IEImgClick questions, & how to find attributes

Recommended Posts


I just discovered AutoIt and am a complete newbie. I'm trying to script interaction with a web site using IE and an unable to ImgClick. A few questions:

1. The first web page successfully loads. On it appears the text "Member Login" which I want to click to take me to a Login page, but that text appears to actually be an image. Following is part of the web page:



<td width="782" height='34' align="right" valign="top" colspan="3" bgcolor="#CC6600" >

<a href="module.php?page=login" style="text-decoration: none"><img border="0" src="../Buttons/7_login.png" width="104" height="31"></a>

<a href="module.php?page=Directory" style="text-decoration: none"><img border="0" src="../Buttons/7_address.png" width="101" height="31"></a>

<a href="module.php?mod=message_board&page=user_folder_list" style="text-decoration: none"><img border="0" src="../Buttons/7_message.png" width="112" height="31"></a>




The image 7_login.png appears with high certainty image associated with the link I want to click. I've tried

_IEImgClick($oIE, "7_login", "src")

and that doesn't cause the new Login page (or any page at all) to be pulled up.

What am I doing wrong? Why is it wrong? What should I be doing?

2. I've obviously searched the forum, and in doing so see examples with code like:

$imgs = $oIE.document.images


$text = $img.alt

Where does one find the names of these object attributes, such as .document.images or .alt

(I don't see any include file or documentation which defines or explains them.)

3. One responder in the forum referred to the "debug bar". I'm using Scite 1.76 and don't see any kind of debug bar. Am I missing something? It appears the only way to debug is with print statements. Is that true?

Many thanks to anyone who can assist.

Share this post

Link to post
Share on other sites

Share this post

Link to post
Share on other sites

Did you try _IEFormImageClick($oIE,"../Buttons/7_login.png") or _IEFormImageClick($oIE,"Buttons/7_login.png") or the other variations?

No, I hadn't, but did after your question and it doesn't make any difference.

Perhaps another clue: I have a MsgBox immediately before the _IEImgClick. Immediately after I have an _IELoadWait followed by a MsgBox, as shown below. Despite the fact that nothing seemed to happen (i.e., Login page didn't come up), the 2nd MsgBox came up immediately after hitting OK to the first one.

MsgBox(0, "Goto User Login", "Ready to click Member Login")

_IEImgClick($oIE, "7_login", "src")


MsgBox(0, "Login Page Arrived", "Login page should show")


Also, can anyone answer my other questions from the first post in this thread. E.g., where are people getting the names of attributes for these objects?


Share this post

Link to post
Share on other sites

Another thought: Does the fact that the link is in a table change anything? I.e., do I somehow need to be extracting it from the table first?

Share this post

Link to post
Share on other sites

Check to see what the actual source of the img is like this:

$oImgs = _IEImgGetCollection($oIE)
For $oImg in $oImgs
    ConsoleWrite($oImg.src & @CR)


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

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