Jump to content



Photo

FF.au3 (V0.6.0.0b)


  • Please log in to reply
486 replies to this topic

#121 colornokia

colornokia

    Seeker

  • New Members
  • 2 posts

Posted 19 August 2009 - 12:24 AM

I'm trying to read and save as file the source of a webpage that contains Cyrillic characters but i'm not able to get them right. I get the English ones write, but the Cyrillic are just some kind of garbage. Here is the source with an example of yandex.ru (popular russian search engine). Am I doing something wrong or FF.au3 doesn't support Cyrillic alphabet?
#Include <FF.au3> If _FFStart("yandex.ru") Then     $sHTML = _FFReadHTML()     If Not @error Then FileWrite ("text.html", $sHTML )     ; filtered source-code     $sHTML = _FFReadHTML("html",7)         FileWrite ("text2.html", $sHTML ) EndIf








#122 ValeryVal

ValeryVal

    Dig the way

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 19 August 2009 - 07:17 AM

It works for me:
#Include <FF.au3> If _FFStart() Then     _FFOpenURL("www.ya.ru")     ;filter HTML tags from body     $sHTML = _FFReadHTML("body",8)     If Not @error Then      $File = FileOpen("text.txt",2)      FileWrite ($File, $sHTML )      FileClose($File)     endif     ;get innerHTML from html     $sHTML = _FFReadHTML("html")     If Not @error Then      $File = FileOpen("text.html",2)      FileWrite ($File, $sHTML )      FileClose($File)     endif EndIf

The point of world view

#123 colornokia

colornokia

    Seeker

  • New Members
  • 2 posts

Posted 19 August 2009 - 08:21 AM

Still NOT working for me >_< It's getting me results like * !45;0BL AB0@B>2>9 * >9B8 2 ?>GBC /=45:A. I'm out of any ideas, I've been looking for workarounds for 8 hours

#124 ValeryVal

ValeryVal

    Dig the way

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 19 August 2009 - 01:27 PM

Still NOT working for me :( It's getting me results like * !45;0BL AB0@B>2>9 * >9B8 2 ?>GBC /=45:A. I'm out of any ideas, I've been looking for workarounds for 8 hours


You should read this page. Yandex page has page charset as windows-1251. The FF thinks that it is UTF-8. You have to get binary content of page.
Javascript can't get it. This .responseBody has IE's object Msxml2.XMLHTTP or XMLHttpRequest, only.

Yes. It is small problem with full binary content of page, I think.
>_<
The point of world view

#125 Rishodi

Rishodi

    Seeker

  • Active Members
  • 13 posts

Posted 19 August 2009 - 04:05 PM

Workaround to find the position of the content area:

$a = ControlGetPos(_FFCmd(".title"), "", "[CLASS:MozillaContentWindowClass]") _ArrayDisplay($a)


https://wiki.mozilla.org/Accessibility/AT-Windows-API#How_to_Find_the_Content_Window_and_Load_the_Document

Excellent, I don't know if I ever would have managed to find that. I already wrote a workaround, but that is much less ugly than what I came up with. Thanks.

#126 ValeryVal

ValeryVal

    Dig the way

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 21 August 2009 - 02:36 PM

@colornokia:

FireFox has window with source of page, too. So there is a head trick to get html source, I think.

>_<
The point of world view

#127 trinitrotoluen

trinitrotoluen

    Adventurer

  • Active Members
  • PipPip
  • 145 posts

Posted 22 August 2009 - 07:10 PM

Even you added Opt("TCPTimeOut", $_FF_CON_DELAY) but it still have that TCP 10053 error, and seem to be more often.

#128 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 406 posts

Posted 23 August 2009 - 09:13 AM

Even you added Opt("TCPTimeOut", $_FF_CON_DELAY) but it still have that TCP 10053 error, and seem to be more often.

More often? The complete line is:
If $_FF_CON_DELAY > 100 Then Opt("TCPTimeout", $_FF_CON_DELAY)

so I don't think you can have more timeouts then before.

I can only try some things, because I can't reproduce this error.

-------

New in the latest test-version:
_FFDispatchEvent($sElement, $sEventType = "change")
$sElement = Element or object from _FFXpath /_FFObj*
$sEventType = change|select|focus|blur|resize

http://thorsten-willert.de/Themen/FFau3/Testversion/FF.au3

#129 trinitrotoluen

trinitrotoluen

    Adventurer

  • Active Members
  • PipPip
  • 145 posts

Posted 23 August 2009 - 04:56 PM

More often? The complete line is:

If $_FF_CON_DELAY > 100 Then Opt("TCPTimeout", $_FF_CON_DELAY)

so I don't think you can have more timeouts then before.

I can only try some things, because I can't reproduce this error.

-------

New in the latest test-version:
_FFDispatchEvent($sElement, $sEventType = "change")
$sElement = Element or object from _FFXpath /_FFObj*
$sEventType = change|select|focus|blur|resize

http://thorsten-willert.de/Themen/FFau3/Testversion/FF.au3

Hi, Stilgar
Actually I don't know where this error come from. It's really strange but I used your previous version this error happened when I compiled the script only if I ran from the editor it didn't happen. But this version it happens even I run from the editor >_<
I will send you my script, please check it if you have free time.
Have a nice day.

Edited by trinitrotoluen, 23 August 2009 - 04:58 PM.


#130 ValeryVal

ValeryVal

    Dig the way

  • Active Members
  • PipPipPipPipPipPip
  • 422 posts

Posted 26 August 2009 - 09:30 AM

I'm trying to read and save as file the source of a webpage that contains Cyrillic characters but i'm not able to get them right. I get the English ones write, but the Cyrillic are just some kind of garbage. Here is the source with an example of yandex.ru (popular russian search engine). Am I doing something wrong or FF.au3 doesn't support Cyrillic alphabet?
[ code='text' ] ( Popup )

See AFireFox_Full - v.1.2. here

Added two buttons:
Execute - call javascript functions from content current page
Source - get page source of current URL (incl. UTF-8)

It works fine with Russian page content, too.
The point of world view

#131 LOULOU

LOULOU

    loulou

  • Active Members
  • PipPipPipPipPipPip
  • 483 posts

Posted 26 August 2009 - 07:00 PM

If want to change programaticaly the action to do with *.lng from always wondering to recording (see thumbnail) Is it possible ?
Thanks in advance
Regards

#132 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 406 posts

Posted 26 August 2009 - 07:25 PM

If want to change programaticaly the action to do with *.lng from always wondering to recording (see thumbnail) Is it possible ?
Thanks in advance
Regards


You can do it by editing the "mimeTypes.rdf" in your profile-dir, or do you wanna change it while FF is running?

#133 LOULOU

LOULOU

    loulou

  • Active Members
  • PipPipPipPipPipPip
  • 483 posts

Posted 26 August 2009 - 08:26 PM

You can do it by editing the "mimeTypes.rdf" in your profile-dir, or do you wanna change it while FF is running?

I want to change it at the beginning of a session and after restore it at the end of the session
I correct a problem in _MozRepl_Detect
The location of firefox when several installation has been made would be correct like this

If $bInstall Then
Local $sHKLM = "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Desktop"
Local $sFFExe = RegRead($sHKLM , "SOFTWARE\Clients\StartMenuInternet\FIREFOX.EXE\shell\open\command")
EndIf


Edited by LOULOU, 26 August 2009 - 08:28 PM.


#134 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 406 posts

Posted 27 August 2009 - 08:11 AM

I want to change it at the beginning of a session and after restore it at the end of the session

It' a bit complicated to made this while FF is running, I'm searching for a solution.

I correct a problem in _MozRepl_Detect
The location of firefox when several installation has been made would be correct like this

Are you sure, that you have "corrected" it?
I have never seen a key like "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Desktop" anywhere. So the _MozRepl_Detect doesn't work here anymore.

I've used the registry descripted e.g. on this page:
https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview
(near the bottom of the page "Plug-in Installation and the Windows Registry" - search for "PathToExe")

#135 LOULOU

LOULOU

    loulou

  • Active Members
  • PipPipPipPipPipPip
  • 483 posts

Posted 27 August 2009 - 05:03 PM

It' a bit complicated to made this while FF is running, I'm searching for a solution.


Are you sure, that you have "corrected" it?
I have never seen a key like "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Desktop" anywhere. So the _MozRepl_Detect doesn't work here anymore.

I've used the registry descripted e.g. on this page:
https://developer.mozilla.org/en/Gecko_P...I_Reference/Plug-in_Development_Overview
(near the bottom of the page "Plug-in Installation and the Windows Registry" - search for "PathToExe")


So IN french XP pack SP3
Your Key is in HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\3.5.2 (fr)\Main
and subkey Pathtoexe The return is C:\Program Files\Mozilla Firefox\firefox.exe
This key is dependant from the version of Firefox installed
Always IN Xp3 the following key
HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Desktop
subkey
SOFTWARE\Clients\StartMenuInternet\FIREFOX.EXE\shell\open\command
return the same thing "C:\Program Files\Mozilla Firefox\firefox.exe" but seems no to be dependant off version

This is only avalaible on French system , i can't try it on another foreign language
Can some one confirm or not this is the same problem in an XP English Version with Firefox 3.2
Thanks

#136 6105

6105

    Polymath

  • Active Members
  • PipPipPipPip
  • 232 posts

Posted 30 August 2009 - 01:27 PM

how to add in include folder FF.au3?? i added in folder but script says, i dont have FF.au3 :D

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


#137 LOULOU

LOULOU

    loulou

  • Active Members
  • PipPipPipPipPipPip
  • 483 posts

Posted 30 August 2009 - 04:10 PM

Error when accessing a table By id
_FFTABLEWritetoarray("tabListeDetail", "id", "text", True)

Here is the error message

__FFSend: try{window.content.wrappedJSObject.frames["top"].document.getElementsByTagName('table').length;}catch(e){'_FFCmd_Err';};
__FFRecv: 9
__FFSend: try{content.document.tabListeDetail}catch(e){'_FFCmd_Err';};
__FFRecv:
__FFSend: try{content.document.tabListeDetail.getElementsByTagName('tr').length}catch(e){'_FFCmd_Err';};
__FFRecv: _FFCmd_Err
_FFCmd ==> Error return value: _FFCmd_Err
FF.au3 (2830) : ==> Array variable subscript badly formatted.:
Local $a_TableCells[$i_cols][$trs]
Local $a_TableCells[^ ERROR
->18:00:35 AutoIT3.exe ended.rc:1
+>18:00:37 AutoIt3Wrapper Finished



#138 Stilgar

Stilgar

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 406 posts

Posted 31 August 2009 - 10:39 AM

@toader:
Do you have saved it as FF.au3 in your include-dir? e.g.:
c:\program files\autoit\include


@LOULOU:
I try to fix this in the next update.

For simple tables (no merged cells, no line breaks in cells) you can try something like this:
Global $aTable[1][1] $a = _FFXpath("//table[@id='tabListeDetail']//tr",default,6) $a[1] = StringStripWS($a[1],3) $aRow = StringSplit($a[1],@crlf) ReDim $aTable[$a[0]][UBound($aRow)-1] For $i = 1 To $a[0]     $a[$i] = StringStripWS($a[$i],3)     $aRow = StringSplit($a[$i],@crlf)     For $j = 0 To $aRow[0]-1         $aTable[$i-1][$j] = StringStripWS($aRow[$j+1],3)     Next Next _ArrayDisplay($aTable)


or this:
For $i = 1 To 100000     $a = _FFXpath("//table[@id='tabListeDetail']//tr[" & $i & "]//td",default,6)     If $a[0] = 0 Then ExitLoop     _ArrayDisplay($a) ; do something with $a Next

Edited by Stilgar, 31 August 2009 - 10:50 AM.


#139 LOULOU

LOULOU

    loulou

  • Active Members
  • PipPipPipPipPipPip
  • 483 posts

Posted 31 August 2009 - 11:11 AM

@toader:
Do you have saved it as FF.au3 in your include-dir? e.g.:
c:\program files\autoit\include


@LOULOU:
I try to fix this in the next update.

For simple tables (no merged cells, no line breaks in cells) you can try something like this:

Global $aTable[1][1] $a = _FFXpath("//table[@id='tabListeDetail']//tr",default,6) $a[1] = StringStripWS($a[1],3) $aRow = StringSplit($a[1],@crlf) ReDim $aTable[$a[0]][UBound($aRow)-1] For $i = 1 To $a[0] $a[$i] = StringStripWS($a[$i],3) $aRow = StringSplit($a[$i],@crlf) For $j = 0 To $aRow[0]-1 $aTable[$i-1][$j] = StringStripWS($aRow[$j+1],3) Next Next _ArrayDisplay($aTable)


or this:
For $i = 1 To 100000 $a = _FFXpath("//table[@id='tabListeDetail']//tr[" & $i & "]//td",default,6) If $a[0] = 0 Then ExitLoop _ArrayDisplay($a) ; do something with $a Next

Hi stligar,
Thanks for answering, I will correct in documentation _FFGetlength /// Tables option is forgotten

#140 6105

6105

    Polymath

  • Active Members
  • PipPipPipPip
  • 232 posts

Posted 31 August 2009 - 10:42 PM

@toader:
Do you have saved it as FF.au3 in your include-dir? e.g.:
c:\program files\autoit\include


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?

Edited by toader, 01 September 2009 - 09:13 AM.

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





2 user(s) are reading this topic

1 members, 1 guests, 0 anonymous users


    autohit