beserk1 Posted September 8, 2006 Posted September 8, 2006 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?
Moderators big_daddy Posted September 8, 2006 Moderators Posted September 8, 2006 If you could post the source for one of these links it would help us provide a solution.
beserk1 Posted September 8, 2006 Author Posted September 8, 2006 <a href="#" onclick="document.snd.t4.value=10">(10)</a> dunno if thats what you are looking for
Moderators big_daddy Posted September 9, 2006 Moderators Posted September 9, 2006 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now