Jump to content

Img Click on website?


Recommended Posts

Hi,

i cant click on a image of a website.

Image i want to click:

<img id="n2" src="img/i/bb/x.gif" title="Xyz title">

how can i click this img with e.g. _IEImgClick ?

I think the problem is that a other img on this page has the same img path but an other id:

<img id="n1" src="img/i/bb/x.gif" title="Other title">

so the better question is... how can i click on the img per id?

Thx for help

Link to comment
Share on other sites

@KillingEye...As you have indicated the title of the links are different....So...

#include <IE.au3>
$oIE = _IECreate("http://www.autoitscript.com")

$sMyString = "wallpaper";Your link text
$oLinks = _IELinkGetCollection($oIE)
For $oLink in $oLinks
    $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
        _IEAction($oLink, "click")
        ExitLoop
    EndIf
Next
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...