Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

FF.au3 (V0.6.0.1b-10)


  • Please log in to reply
636 replies to this topic

#141 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 01 September 2009 - 12:52 PM

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?







#142 6105

6105

    Polymath

  • Active Members
  • PipPipPipPip
  • 232 posts

Posted 01 September 2009 - 07:29 PM

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

Die die die my darling

Don't utter a single word

Die die die my darling

Just shut your pretty mouth

I'll be seeing you again

I'll be seeing you

In hell


#143 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 01 September 2009 - 07:34 PM

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.

#144 6105

6105

    Polymath

  • Active Members
  • PipPipPipPip
  • 232 posts

Posted 02 September 2009 - 10:24 PM

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, 02 September 2009 - 10:24 PM.

Die die die my darling

Don't utter a single word

Die die die my darling

Just shut your pretty mouth

I'll be seeing you again

I'll be seeing you

In hell


#145 fspafford

fspafford

    Seeker

  • Active Members
  • 28 posts

Posted 03 September 2009 - 01:44 PM

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

#146 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 04 September 2009 - 09:16 AM

; 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, 04 September 2009 - 09:51 AM.


#147 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 04 September 2009 - 10:26 AM

Updated to V0.5.3.8b.
Look at the first post for changes, please.

@LOULOU:
_FFTableWriteToArray should work now.

#148 slayerz

slayerz

    Prodigy

  • Active Members
  • PipPipPip
  • 160 posts

Posted 05 September 2009 - 09:55 AM

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 I'm lovin' it!

#149 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 05 September 2009 - 10:37 AM

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

#150 morawcik

morawcik

    Seeker

  • Active Members
  • 17 posts

Posted 08 September 2009 - 06:28 AM

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("<a href='http://www.molehillempire.com' class='bbc_url' title='External link' rel='nofollow external'>http://www.molehillempire.com"</a>) _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 ?

#151 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 08 September 2009 - 09:07 AM

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)


#152 morawcik

morawcik

    Seeker

  • Active Members
  • 17 posts

Posted 08 September 2009 - 10:04 AM

Thanks, its work :D

#153 morawcik

morawcik

    Seeker

  • Active Members
  • 17 posts

Posted 08 September 2009 - 12:01 PM

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 ?

#154 trinitrotoluen

trinitrotoluen

    Adventurer

  • Active Members
  • PipPip
  • 145 posts

Posted 16 September 2009 - 05:21 PM

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


Hi,
How can I click on the image like that ?

#155 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 16 September 2009 - 06:31 PM

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, 16 September 2009 - 06:34 PM.


#156 stratosgr

stratosgr

    Seeker

  • Active Members
  • 6 posts

Posted 19 September 2009 - 08:23 AM

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

#157 morawcik

morawcik

    Seeker

  • Active Members
  • 17 posts

Posted 22 September 2009 - 09:21 AM

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 ?

#158 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 22 September 2009 - 10:07 AM

@ 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.

#159 morawcik

morawcik

    Seeker

  • Active Members
  • 17 posts

Posted 22 September 2009 - 11:30 AM

Only it's work ?

#160 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 423 posts

Posted 22 September 2009 - 11:39 AM

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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users