sonic208

firefox au3 doesnt work for clicking on a button

38 posts in this topic

hey guys, im from germany but seeking help her since here nobody can help me. Im trying to click a sign in button but nomatter whether i try it with ffclick oder indirectly via ffxpath, it wont work. on other sites it works fine . the buttons there seem to be different. so here´s the site and the html code of xpath that i get : https://www.deutschlandcard.de/netto-registrierung-az

<button class="button showStep2 next signupWithoutCard button-large" tabindex="0">Jetzt kostenlos anmelden</button>

i want to click the "jetzt anmelden" button

#Include <FF.au3>

Example()

Func Example()


    _FFStart("https://www.deutschlandcard.de/netto-registrierung-az", "default", 1, False) ; Die URL, FF-default-Profil, "1" für "immer neuen Prozess für FireFox starten", "False" für "sichtbar"


If _FFIsConnected() Then

    ;_FFClick("img", "tag", 5) ; clicks on the 5th image

    Sleep(1000)





_FFClick("button showStep2 next signupWithoutCard button-large","class")




    Sleep(10000)
    _FFWindowClose()
Else
    MsgBox(0,"Error:", "Can't connect to FireFox!")
EndIf

EndFunc

 

Share this post


Link to post
Share on other sites



You could try something like this --

#Include <FF.au3>

Example()

Func Example()


    _FFStart("https://www.deutschlandcard.de/netto-registrierung-az", "default", 1, False) ; Die URL, FF-default-Profil, "1" für "immer neuen Prozess für FireFox starten", "False" für "sichtbar"


If _FFIsConnected() Then
    $oButton = _FFXPath("//button[@class='button showStep2 next signupWithoutCard button-large']")
    _FFClick($oButton)
EndIf

EndFunc

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Both scripts worked here..

Im on FF V0.6.0.1b-15

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites
41 minutes ago, sonic208 said:

 

what really ? i tried the script now from danp2 and it also  didnt work .. omg what can the problem be ?

Share this post


Link to post
Share on other sites

Your MozRepl off... FF version...
 idk


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

hmm ff and mozrepl are on the latest version.. with other scripts its working.. the only difference was that on other sites the button was always defined with an id, here on this site this button doesnt load a new page , it immediately jumps to the form. perhaps that can be the reason ? the strange thing is on other normal sites where the button is a "normal" button the script worked perfectly. so mozrepl autoit and firefox should be working fine. i am really really confused that it works for you . i was sure it has something with the html code to do.

Share this post


Link to post
Share on other sites

My firefox is v.50.1.0

I would clear the firefox cache and cookie associated. Other than that, no clue.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

omg i found the solution....... i downloaded the ff.au3 from your forum and it works fine... thanks careca and dan , your answer that it works for you made me think about what is different in germany... and then i knew the ff.au3 !! :D:D i downloaded it from a german page and not from this forum.

thanks guys thanks for the quick answers and willingness to help

Share this post


Link to post
Share on other sites

but i forgot there is another important question that i have.How do i read a text line ? the text is always at the same place

id give you the link but youve got to login for that, hopefully the html can help or my wrong script perhaps ?

$hallo = _FFXPath(".//*[@id='linkDCC']/div[1]/span[3]")

MsgBox(0,"hi",_FFObj($hallo))

 

Share this post


Link to post
Share on other sites

#10 ·  Posted

 

<span style="padding-left: 60px;">0  Punkte</span>

 

Share this post


Link to post
Share on other sites

#11 ·  Posted

_FFReadText ?

maybe _FFObjGet. Im not much into it.

Danp2 knows for sure. Helped me much in the past.


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

#12 ·  Posted

Can't give it for you with the given info. Once you figure out the correct xpath, you can take the result from _FFXPath and then retrieve the text using

$data = _FFCmd("FFau3.xpath.innerHTML")

or

$data = _FFCmd("FFau3.xpath.textContent")

 

Share this post


Link to post
Share on other sites

#13 ·  Posted

ok allright ill try it out  later... i know it might sound silly but right now im stuck with the radio button for male .. i really cant understand the _FFFormRadioButton Function..

<input class="mandatory" value="M" name="gender" tabindex="1" type="radio"/>

i understood it that way that the funcition only needs the value or name of the radio button ? Both variations, typing "M" in brackets after _FFFormRadioButton and "gender" do not work..

Share this post


Link to post
Share on other sites

#14 ·  Posted

now i tried it with the index wont work either... what am i doing wrong ? 

#Include <ff3.au3>

Example()

Func Example()


    _FFStart("https://www.deutschlandcard.de/netto-registrierung-az", "default", 1, False) ; Die URL, FF-default-Profil, "1" für "immer neuen Prozess für FireFox starten", "False" für "sichtbar"


If _FFIsConnected() Then
    $oButton = _FFXPath("//button[@class='button showStep2 next signupWithoutCard button-large']")
    _FFClick($oButton)
    Sleep(1000)
    _FFFormRadioButton(1, 0, "index")
EndIf

EndFunc

 

Share this post


Link to post
Share on other sites

#15 ·  Posted

i got it... im sry for the silly question  ... sry sry. i hope that later i will also understand how to read the text and wont be bothering you

for the ones who are interested , this is how it worked ( fu*k my brain, how silly am i ) 

_FFFormRadioButton("M", 1,"value")

how can i delete posts ?

Share this post


Link to post
Share on other sites

#16 ·  Posted

Dont worry about it, glad you solved it. But maybe next time just edit last post instead of posting again every few minutes ;)


Spoiler

Paster - Main function is to paste text, but has more functions.

OpenW - Open With... alternative, Open any file with any application, set it's icon, set application as default.

Renamer - Rename files and folders, remove portions of text from the filename etc.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Share this post


Link to post
Share on other sites

#17 ·  Posted

Glad that you were able to figure it out.

Don't delete or edit your posts to remove the questions. Others coming behind you can still benefit from the exchange. ;-)

Share this post


Link to post
Share on other sites

#18 ·  Posted

ok :D so i got so far that im at the page with the text, but with both ways it doenst work. i think the html code is interesting, the text stands after a checkbox:

 

 

<input class="checkbox card-to-replace" name="cards[]" value="1263302459" tabindex="1" type="checkbox"/>
<label for="cards">1263302459</label>

xpath leads me only to the second line, i just added the line that stands above perhaps thats the solution .

hmm i just see now that i perhaps can get it by getvalue ?

after reading this textfield i would need it at another one too, but for that text perhaps your functions will work. first ill do it step by step and hopefully read this textline.

Share this post


Link to post
Share on other sites

#19 ·  Posted

or is the source code the problem ? i mean the way i understood your both variations ?

$card = _FFCmd("FFau3.//*[@id='checkboxDisable']/li[1]/label.innerHTML")
    MsgBox(0,"",$card)

sry i still didnt find the edit button to edit a post ?

Share this post


Link to post
Share on other sites

#20 ·  Posted

You left out the call to _FFXPath.

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