Jump to content
Sign in to follow this  

dynamic _IELinkClickByText

Recommended Posts

I want to click a link that perform a Java(?) action, but the links is base on the value it generate.

The link contained the follow code


When you click on this link, it will put the value '321' in the box name 't5'. However, the name of the link is base on the value, in this case this link text is '(321)'.

Another difficulty is that I have a few links of the same type, so I can't just search for one.

Is there some way I can't search for a link that match centain rules? For example, within a for loop, all those links those contain value greater than 10 would be click, and others would be left alone?

Share this post

Link to post
Share on other sites

See if this works for you.

#include <IE.au3>

$sURL = "www.your-webpage.com"
$oIE = _IECreate($sURL)
$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    $sTemp = $oLink.outerText
    $aValue = StringRegExp($sTemp, "(?:\(){1}([:digit:]+)(?:\)){1}", 1)
    If @extended Then
        $iValue = Number($aValue[0])
    If $iValue > 10 Then
        _IELinkClickByText($oIE, $sTemp)

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  

  • Create New...