FF.au3 (V0.6.0.1b-10)

679 posts in this topic

#141 ·  Posted

yes is in .../autoit/include

now all is good.. but have new problem in FF - Page Analyzer.. can understand how to add page :D can u say me? i pushed all butons.. but that dont help((

and somebody know how i can do controlclick, controlsend in FFwindow?

FF-Page-Analyzer:

- Open FireFox and the page you want to analyze

- Click on the "FF-Page-Analyzer" the "analyze" button

- wait for the result

You can't use controlclick, controlsend ... with FF, because it's a XUL application.

What you wanna do?

Share this post


Link to post
Share on other sites



#142 ·  Posted

You can't use controlclick, controlsend ... with FF, because it's a XUL application.

What you wanna do?

i want to send needed text,

like this:

y = 100

copy wood = x

then z = y-x

and to wrote "z" in needed edit place


[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Share this post


Link to post
Share on other sites

#143 ·  Posted

i want to send needed text,

like this:

y = 100

copy wood = x

then z = y-x

and to wrote "z" in needed edit place

If you can show me the page or the HTML-Source of it then I can give you an example.

Share this post


Link to post
Share on other sites

#144 ·  Posted (edited)

If you can show me the page or the HTML-Source of it then I can give you an example.

for test and example we can use this "http://www.muligambia.com/"

in little orange chat box to can send "its work"...

i think is 3 functions, click on edit box, write text, and simulate enter

Edited by toader

[center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Don't utter a single word[/font][/center][center][font=courier new,courier,monospace]Die die die my darling[/font][/center][center][font=courier new,courier,monospace]Just shut your pretty mouth[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you again[/font][/center][center][font=courier new,courier,monospace]I'll be seeing you[/font][/center][center][font=courier new,courier,monospace]In hell[/font][/center]

Share this post


Link to post
Share on other sites

#145 ·  Posted

Stilgar,

I have a question about _FFTableGetCell. I am using version $_FF_AU3VERSION = "0.5.3.7b".

This code excerpt begining at line 124:

; title of the current page

$sTitle = _FFCmd( ".title")

;If Not @error Then MsgBox(64,"Title of the current page:",$sTitle)

if $sTitle <> "UserMgmtView.htm" Then

SetError (1)

EndIf

$cell = _FFTableGetCell("Users", 2, 2, "id")

ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $cell = ' & $cell & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

$val = _FFXPath ("/html/body/form[@id='Form1']/center/table[@id='Users']/tbody/tr[2]/td[2]")

ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $val = ' & $val & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

shows this console output:

__FFRecv: UserMgmtView.htm

__FFSend: try{content.document.getElementsByTagName('tbody')['Users'].getElementsByTagName('tr')[2].getElementsByTagName('td')[2].textContent;}catch(e){'_FFCmd_Err';};

__FFRecv: _FFCmd_Err

_FFCmd ==> Error return value: _FFCmd_Err

@@ Debug(132) : $cell =

>Error code: 8

__FFSend: FFau3.xpath=null;try{FFau3.xpath=window.content.frames[2].document.evaluate("/html/body/form[@id='Form1']/center/table[@id='Users']/tbody/tr[2]/td[2]",window.content.frames[2].document,null,XPathResult.STRING_TYPE,null).stringValue;}catch(e){'_FFXPath_Error: '+e;};

_FFTableGetCell ==> No match: Table/Column/Row: Users/2/2

__FFRecv:  us0 

@@ Debug(135) : $val =  us0 

>Error code: 0

I went with _FFXPath because I could not get _FFTableGetCell to work. Do you see any problems?

Regards,

Frank


Frank

Share this post


Link to post
Share on other sites

#146 ·  Posted (edited)

; title of the current page

$sTitle = _FFCmd( ".title")

;If Not @error Then MsgBox(64,"Title of the current page:",$sTitle)

if $sTitle <> "UserMgmtView.htm" Then

SetError (1)

EndIf

$cell = _FFTableGetCell("Users", 2, 2, "id")

ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $cell = ' & $cell & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

$val = _FFXPath ("/html/body/form[@id='Form1']/center/table[@id='Users']/tbody/tr[2]/td[2]")

ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $val = ' & $val & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console

shows this console output:

__FFRecv: UserMgmtView.htm

__FFSend: try{content.document.getElementsByTagName('tbody')['Users'].getElementsByTagName('tr')[2].getElementsByTagName('td')[2].textContent;}catch(e){'_FFCmd_Err';};

__FFRecv: _FFCmd_Err

_FFCmd ==> Error return value: _FFCmd_Err

@@ Debug(132) : $cell =

>Error code: 8

__FFSend: FFau3.xpath=null;try{FFau3.xpath=window.content.frames[2].document.evaluate("/html/body/form[@id='Form1']/center/table[@id='Users']/tbody/tr[2]/td[2]",window.content.frames[2].document,null,XPathResult.STRING_TYPE,null).stringValue;}catch(e){'_FFXPath_Error: '+e;};

_FFTableGetCell ==> No match: Table/Column/Row: Users/2/2

__FFRecv:  us0 

@@ Debug(135) : $val =  us0 

>Error code: 0

Hello,

the only thing I see, is that

_FFTableGetCell("Users", 2, 2, "id")

and

_FFXPath("//table[@id='Users']//tr[2]/td[2]")

aren't the same cells, because the index in XPath is from 1-n and in HTML from 0-n

so

_FFTableGetCell("Users", 1, 1, "id")

should work.

@toader:

OMG more bugs then HTML on this page and you must disable all security addons to get it to work :D

But it works: (you must have the latest version of the FF.au3 - 0.5.3.8b)

If _FFFrameEnter("JABBIFYNAME","name") Then

        $sName = "test"
        $sObj = _FFXPath("//div[@id='jabbify']//form/input","",9)
        _FFObj($sObj, "value", $sName)
        _FFDispatchKeyEvent($sObj, 13) ; pressing "enter" on the input-field

        ; or a little bit different
        $sText = "it works ..."
        _FFXPath("//div[@id='jabbify']//textarea","value='" & $sText & "'",9)
        _FFDispatchKeyEvent(".getElementsByClassName('jab_textarea')[0]", 13)

        _FFFrameLeave()
    EndIf

bad example :D

Normaly it looks much simpler. E.g. if you wanna use the search feature on this page:

#include <FF.au3>

If _FFConnect() Then
    _FFSetValueById("s", "TextToSearch")
    _FFFormSubmit()
EndIf
Edited by Stilgar

Share this post


Link to post
Share on other sites

#148 ·  Posted

I had tried FF.au3, and thanks to the author.It's really helpful. BTW, is there any possibility to automate the installation of mozrepl.xpi? Maybe we can install it using command-line.

Regards,

slayerz


AUTOIT[sup] I'm lovin' it![/sup]

Share this post


Link to post
Share on other sites

#149 ·  Posted

I had tried FF.au3, and thanks to the author.It's really helpful. BTW, is there any possibility to automate the installation of mozrepl.xpi? Maybe we can install it using command-line.

Thank you!

You can use this function to install MozRepl:

_MozRepl_Detect

Share this post


Link to post
Share on other sites

#150 ·  Posted

Hi.

I have some problem.

When I want selected some option in the login form on the site http://www.molehillempire.com/ i use this:

If _FFConnect() Then
_FFOpenURL("http://www.molehillempire.com")
_FFSetValueById("login_user", "login")
_FFSetValueById("login_pass", "pass")
_FFCmd(".forms[1].elements[0].option[3].selected")
EndIf

But this _FFCmd don't work. I don't have any idea. Someone can help mi ?

Share this post


Link to post
Share on other sites

#151 ·  Posted

Hi.

I have some problem.

When I want selected some option in the login form on the site http://www.molehillempire.com/ i use this:

If _FFConnect() Then
_FFOpenURL("http://www.molehillempire.com")
_FFSetValueById("login_user", "login")
_FFSetValueById("login_pass", "pass")
_FFCmd(".forms[1].elements[0].option[3].selected")
EndIf

But this _FFCmd don't work. I don't have any idea. Someone can help mi ?

With this you ask IF this options IS selected:

_FFCmd(".forms[1].elements[0].option[3].selected")

You can select it with this:

_FFCmd(".forms[1].elements[0].selectedIndex=3")

Or you use the function _FFFormOptionselect:

_FFFormOptionselect("server","name",3)

Share this post


Link to post
Share on other sites

#152 ·  Posted

Thanks, its work :D

Share this post


Link to post
Share on other sites

#153 ·  Posted

Hi.

I have another problem.

When i get inner html from site (utf-8):

GUICtrlSetData($labPoziom, _FFCmd(".getElementById('level').innerHTML"))

I get:

SaBatkowy czeladnik

but on the site is:

Sałatkowy czeladnik (polish lang)

In SciTE im using utf-8 encoding.

How I can fix that or change all char ż,ź,ć,ł,ń,ś,ą,ó to z, c,l,n,s,a,o ?

Share this post


Link to post
Share on other sites

#154 ·  Posted

<input class="image" type="image" src="images/click-me.gif"/>

Hi,

How can I click on the image like that ?

Share this post


Link to post
Share on other sites

#155 ·  Posted (edited)

How I can fix that or change all char ż,ź,ć,ł,ń,ś,ą,ó to z, c,l,n,s,a,o ?

I'll try to fix this.

How can I click on the image like that ?

<input class="image" type="image" src="images/click-me.gif"/>

You can click on it with e.g.

_FFClick("image", "class")
; or
_FFClick(".forms[n].elements[n]") ; replace n with the index
; or
_FFClick( _FFXPath("//input[@type='image' and @src='images/click-me.gif']", "", 9 ))
Edited by Stilgar

Share this post


Link to post
Share on other sites

#156 ·  Posted

Hi there,

When trying to get information from websites containing non-english language i get non readable text (see attached image)..

Heres an example:

#include <FF.au3>
#include <Array.au3>

_FFConnect()
If _FFIsConnected() Then
    _FFOpenUrl("www.google.gr")
    $aLinks = _FFLinksGetALL()
    _ArrayDisplay($aLinks)
EndIf

I tried converting to binary and then back to utf-8 with no luck. The scite editor is on UTF-8 encoding.

Theres no problem when doing the same thing using ie and ie.au3 but i really need to use firefox and _FFXPath() function, which by the way, both rules.

Thnx in advance :D

Attached image:

Posted Image

Share this post


Link to post
Share on other sites

#157 ·  Posted

I'll try to fix this.

Thanks.

I have another problem. When i make bot to game (molehillempire.com) and i need do any actions i need use _FFTabSetSelected or tab with game must be open. When bot runs actions every time i can't work on FF.

Can i do sth on this game tab when i work on other tab ?

Share this post


Link to post
Share on other sites

#158 ·  Posted

@ stratosgr:

Hello,

like I said on post before yours: I'll try to fix this :D

@morawcik:

Just open a new FireFox-window and work there.

Share this post


Link to post
Share on other sites

#159 ·  Posted

Only it's work ?

Share this post


Link to post
Share on other sites

#160 ·  Posted

Only it's work ?

Sorry I don't understand what you mean.

Just let your script work in one browser window and you can use an other window.

Share this post


Link to post
Share on other sites
This topic is now closed to further replies.