Jump to content
Sign in to follow this  
Vitaliy4us

_FFClick function's arguments do not work

Recommended Posts

Vitaliy4us

There is a button on a page created with HTML code:

<div class="product_size_item                          
        sizes__button_on
        "
        data-stock="3"
        data-mdp-id="12091904"
        data-sizetype="Unspecified"
        >
        39                                                               
    </div>

Is it possible to use this data as arguments of function _FFClick () for clicking on this button? I tried these ones:

_FFClick("product_size_item sizes__button_on ", "class", 2)
_FFClick("12091904", "id")
_FFClick("12091904")
_FFCmd(".getElementById('12091904').onclick();")

but it does not work.

Share this post


Link to post
Share on other sites
Danp2

Sounds like the issue is something besides _FFClick. You'll need to provide some more details (a script that we can run to demonstrate the issue, output from the Scite window, etc) if you want further assistance. 

Share this post


Link to post
Share on other sites
Vitaliy4us

Thank you for your reply. You are absolutely right. As I found out, the problem lays in another field. Actually, function

_FFClick("product_size_item sizes__button_on ", "class", 2)

works and returns 1 which means successful result. But nothing happens. I mean that the button is not really pressed. For example we have 3 buttons. If we use 0,1 or 2 as the last function's argument, the function returns 1 but no button is pressed. If we use 3, the function returns 0. The very simple code is attached:

#Include <FF.au3>

Opt("WinTitleMatchMode", 2)
WinActivate ("Mozilla Firefox")
Sleep (1000)

_FFConnect()
Sleep (1000)
_FFOpenURL ("https://modnakasta.ua/product/7499459/")
Sleep (1000)

For $i = 0 to 3
    Local $result = _FFClick("product_size_item sizes__button_on ", "class", $i)
    Sleep (1000)
    MsgBox (0, "", $result)
Next

 

Share this post


Link to post
Share on other sites
Vitaliy4us

What exactly isn't working as expected? When I run your script, each button is selected (highlighted in green) as I would expect.

​But I am not able to do the same. Any button is highlighted in green after using FFClick :(

Share this post


Link to post
Share on other sites
Vitaliy4us

Sorry but I don't understand. Exactly what isn't working for you? 

​The script does nothing. The buttons are not selected (they are not highlighted in green). And now I know the reason. The reason is Firefox version. The script starts working after installing the older version (14) instead of the newest 37 version. Could you tell me what is your Firefox version?

Edited by Vitaliy4us

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  

×