Jump to content

Internet Explorer Automation UDF library - clicking Image Problem


Lupus
 Share

Recommended Posts

Hi all,

I use the UDF Library for IE (IE.au3).

I can walk trough a webpage perfectly, but on one page i cant click an image button.

The image is inside of a table (first row);

Can someone help me?

I tried it like this:

$o_Table=_IETableGetObjByIndex($o_IE,4)
_IEClickImg($o_table, "img/btn_weiter.jpg", "src")

The table 4 in the HMTL Code looks like this:

<table cellpadding="2" cellspacing="2" border="0" width="100%">

<tr><td colspan="2" class="tdh">Job als Grabpfleger</td></tr>

<tr>

<td class="tdn">Arbeitszeit:</td>

<td class="tdn">

<select name="arbeitszeit" size="1" class="input">

<option value="1">1 Stunden</option><option value="2">2 Stunden</option><option value="3">3 Stunden</option><option value="4">4 Stunden</option><option value="5">5 Stunden</option><option value="6">6 Stunden</option><option value="7">7 Stunden</option><option value="8">8 Stunden</option> </select>

</td>

</tr>

<tr><td align="center" colspan="2" class="tdn"><input type="image" src="img/btn_weiter.jpg"></td></tr>

</table>

Can anybody help me?

Edited by Lupus
Link to comment
Share on other sites

i have done pretty well with IE.au3... and not unserstanding it at all times...

but the help files/examples are REALLY helpful

i notice the help file using the "object" to click the pic... like this

_IEClickImg($oIE, "Start new topic", "alt")

so for you would it be....

_IEClickImg($o_IE, "img/btn_weiter.jpg", "src")

( seeing "$o_IE" as your object )

i created an IE au3 Builder... it helps me all the time

http://www.autoitscript.com/forum/index.ph...st=0&p=137835

8)

NEWHeader1.png

Link to comment
Share on other sites

What you are trying to enumerate is an <input type="image>

There are actually several sources of trouble here. First is that, even though the element you want is housed in a table, hierarchically in the DOM it is not an element of the table. Second, even though it is a form element, it is not recognized in the form element collection (an obvious problem in the DOM having to do with when the tag became scriptable). Third, even though it has many properties of an Image, it is not one of those either and does not show up in the Images collection used by _IEClickImg().

One way to get at it is to use _IETagNameGetCollection($oIE.document, "input") to create a collection of all Input elements on the page. Then loop through these elements to find the one you want...

$src = "img/btn_weiter.jpg"
$oInputs = _IETagNameGetCollection($oIE.document, "input")
For $oInput in $oInputs
    If $oInput.src = $src 
    Then
         $oInput.click
         ExitLoop
    EndIf
Next

Dale

Edit: changed

_IETagNameGetCollection($oIE, "input") to

_IETagNameGetCollection($oIE.document, "input")

Edited by DaleHohm

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

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...