Jump to content

FF.au3 (V0.6.0.1b-10)


Stilgar
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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

Link to comment
Share on other sites

; 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
Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

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)
Link to comment
Share on other sites

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 ?

Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...