colornokia Posted August 19, 2009 Posted August 19, 2009 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
ValeryVal Posted August 19, 2009 Posted August 19, 2009 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
colornokia Posted August 19, 2009 Posted August 19, 2009 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
ValeryVal Posted August 19, 2009 Posted August 19, 2009 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 hoursYou 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
Rishodi Posted August 19, 2009 Posted August 19, 2009 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.
ValeryVal Posted August 21, 2009 Posted August 21, 2009 @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
trinitrotoluen Posted August 22, 2009 Posted August 22, 2009 Even you added Opt("TCPTimeOut", $_FF_CON_DELAY) but it still have that TCP 10053 error, and seem to be more often.
Stilgar Posted August 23, 2009 Author Posted August 23, 2009 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 jEdit4AutoIt PlanMaker_UDF Â Â
trinitrotoluen Posted August 23, 2009 Posted August 23, 2009 (edited) 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 August 23, 2009 by trinitrotoluen
ValeryVal Posted August 26, 2009 Posted August 26, 2009 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
LOULOU Posted August 26, 2009 Posted August 26, 2009 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
Stilgar Posted August 26, 2009 Author Posted August 26, 2009 If want to change programaticaly the action to do with *.lng from always wondering to recording (see thumbnail) Is it possible ? Thanks in advance RegardsYou can do it by editing the "mimeTypes.rdf" in your profile-dir, or do you wanna change it while FF is running? jEdit4AutoIt PlanMaker_UDF Â Â
LOULOU Posted August 26, 2009 Posted August 26, 2009 (edited) 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 sessionI correct a problem in _MozRepl_DetectThe 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 August 26, 2009 by LOULOU
Stilgar Posted August 27, 2009 Author Posted August 27, 2009 I want to change it at the beginning of a session and after restore it at the end of the sessionIt' a bit complicated to made this while FF is running, I'm searching for a solution.I correct a problem in _MozRepl_DetectThe location of firefox when several installation has been made would be correct like thisAre 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") jEdit4AutoIt PlanMaker_UDF Â Â
LOULOU Posted August 27, 2009 Posted August 27, 2009 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)\Mainand subkey Pathtoexe The return is C:\Program Files\Mozilla Firefox\firefox.exeThis key is dependant from the version of Firefox installed Always IN Xp3 the following keyHKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Desktopsubkey SOFTWARE\Clients\StartMenuInternet\FIREFOX.EXE\shell\open\commandreturn the same thing "C:\Program Files\Mozilla Firefox\firefox.exe" but seems no to be dependant off versionThis is only avalaible on French system , i can't try it on another foreign languageCan some one confirm or not this is the same problem in an XP English Version with Firefox 3.2Thanks
6105 Posted August 30, 2009 Posted August 30, 2009 how to add in include folder FF.au3?? i added in folder but script says, i dont have FF.au3 [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]
LOULOU Posted August 30, 2009 Posted August 30, 2009 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
Stilgar Posted August 31, 2009 Author Posted August 31, 2009 (edited) @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 August 31, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Â Â
LOULOU Posted August 31, 2009 Posted August 31, 2009 @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
6105 Posted August 31, 2009 Posted August 31, 2009 (edited) @toader:Do you have saved it as FF.au3 in your include-dir? e.g.:c:\program files\autoit\includeyes is in .../autoit/includenow all is good.. but have new problem in FF - Page Analyzer.. can understand how to add page can u say me? i pushed all butons.. but that dont help((and somebody know how i can do controlclick, controlsend in FFwindow? Edited September 1, 2009 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]
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now