Jump to content
Sign in to follow this  
Kashgari

Index of link sting, firefox click

Recommended Posts

Kashgari

I have a simple task to click several links on a website , the link structure is like these:

<a href="javascript:vote(418,3610,7,'69d2a72d579e02bdad5230fe708b43be',10)">Vote</a>
<a href="javascript:vote(418,4207,6,'d60ab6a37452ea9ef0ec42166e6d0574',10)">Vote</a>
<a href="javascript:vote(418,5209,4,'392e7369bf1c85da43cdef9b09c468d0',10)">Vote</a>

I can manage to click using :

_FFLinkClick("javascript:vote")

but it clicks the same link again and again, how can I make a simple script to click next link, I believe it would be combination of "href" value and "index" value, I do not know how to write the script.

Please help

Edited by Kashgari

Share this post


Link to post
Share on other sites
Stilgar

Hello,

you can call the Java Script-functions without clicking, too:

#include <FF.au3>

If _FFConnect() Then
    $aJS = _FFXpath("//a[contains(@href, 'vote')]", "", 6) ; getting all vote-links
    For $i = 1 To $aJS[0]
        _FFCmd("content.wrappedJSObject." & StringMid($aJS[$i], 12)) ; call the Javascript-function
        _FFLoadWait()
    Next
EndIf
Edited by Stilgar

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.