Sign in to follow this  
Followers 0
beserk1

dynamic _IELinkClickByText

4 posts in this topic

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

onclick="document.snd.t5.value='321'

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



If you could post the source for one of these links it would help us provide a solution.

Share this post


Link to post
Share on other sites

<a href="#" onclick="document.snd.t4.value=10">(10)</a>

dunno if thats what you are looking for

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])
    Else
        ContinueLoop
    EndIf
    If $iValue > 10 Then
        _IELinkClickByText($oIE, $sTemp)
    EndIf
Next

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  
Followers 0