bo8ster Posted March 3, 2009 Share Posted March 3, 2009 Great library Stilgar - thankyou! Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
trinitrotoluen Posted March 3, 2009 Share Posted March 3, 2009 @trinitrotoluen:I see, I change this in the next version, again and I'll send you an other version tomorrow.Thank you Link to comment Share on other sites More sharing options...
iLoveAU3 Posted March 3, 2009 Share Posted March 3, 2009 Have you closed FireFox before you tried the new version?no i have not hehe. everything works fine now. thanks man! Link to comment Share on other sites More sharing options...
trinitrotoluen Posted March 4, 2009 Share Posted March 4, 2009 Excuse me, Stilgat, I have downloaded your newest version (Mar 02) but it still can't open mutilple FFs. Can you send me the 0.4.0.1 version that worked I need it for some works, I've lost it. Have a nice work ! Link to comment Share on other sites More sharing options...
Stilgar Posted March 5, 2009 Share Posted March 5, 2009 @bo8ster, iLoveAU3 Thank you! @trinitrotoluen: I've uploaded a new version. Now it works with different ports again. jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
laosoi Posted March 6, 2009 Share Posted March 6, 2009 Sorry! How can i read or get URL from address bar? Thanks in advance! Link to comment Share on other sites More sharing options...
Stilgar Posted March 6, 2009 Share Posted March 6, 2009 (edited) Sorry! How can i read or get URL from address bar? Thanks in advance! #include <FF.au3> $Socket = _FFConnect() ; connecting to FF / MozRepl $sHREF = _FFSetGet($Socket,".location.href") ; the current URL MsgBox(64,"",$sHREF)oÝ÷ Úߢ»ayÚºg§¶åÉ«¢+ØÀÌØíÍ!Iô}MÑÐ ÀÌØíM½Ð°ÅÕ½Ðì¹UI0ÅÕ½Ðì Edited March 6, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted March 9, 2009 Share Posted March 9, 2009 expandcollapse popup#region #CURRENT# ============================================================== ;_FFAction ;_FFClick ;_FFClickImage ;_FFClickImageBySize ;_FFClickLink ;_FFConnect ;_FFDisConnect ;_FFDisPatchKeyEvent ;_FFFormCheckBox ;_FFFormGetLength ;_FFFormOptionselect ;_FFFormRadioButton ;_FFFormReset ;_FFFormSubmit ;_FFFrameEnter ;_FFFrameGetSelected ;_FFFrameLeave ;_FFGetLength ;_FFGetObject ;_FFGetValueById ;_FFGetValueByName ;[b]_FFGetValueByXPath[/b]; now is _FFXpath ;_FFLinksGetAll ;_FFLoadWait ;_FFOpenURL ;_FFQuit ;_FFReadHTML ;_FFReadText ;_FFSearch ;_FFSetGet ;_FFSetValueById ;_FFSetValueByName ;_FFStart ;_FFTabAdd ;_FFTabClose ;_FFTabCloseAll ;_FFTabDuplicate ;_FFTabExists ;_FFTabGetLength ;_FFTabGetSelected ;_FFTabSetSelected ;_FFTableGetCell ;_FFTableWriteToArray #endregion #CURRENT#;=========================================================== Seem _FFXpath somtimes returns "" when fail not always 0 Link to comment Share on other sites More sharing options...
Stilgar Posted March 9, 2009 Share Posted March 9, 2009 @trinitrotoluen:It returns 0 if your XPath expression is wrong or the number of elements ( $iReturnType = 1 ) is 0. If the return value is "" and you have STRING_TYPE as return type then your expression have nothing found.Or have you have an other example where it fails? jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted March 9, 2009 Share Posted March 9, 2009 When I input the wrong query, it returned "", I set all default. ps: This function sometimes hang on. Link to comment Share on other sites More sharing options...
Stilgar Posted March 9, 2009 Share Posted March 9, 2009 (edited) What did you mean with "wrong query"? A query that found nothing or a query with a wrong expression?If you try this: _FFXPath($Socket,"qwert")there's nothing wrong, but the expression can't find anything.If you try this:_FFXPath($Socket,"////")then you run into an error, because that's an illegal expression.If've tried many many things with it and I never have a problem with it, IF you use the right return types and XPath queries.You can look for examples there:Evaluate examples with greasemonkey Edited March 9, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
drdave Posted March 9, 2009 Share Posted March 9, 2009 How would or could you intercept a http request before the page finishes loading? Example. A user types or click a url. Then firefox starts to transfer the page. I would like to get the url before the page is loaded. I know I can use "$sHREF = _FFSetGet($Socket,".location.href")", but I am not sure at what point the location changes. The page status changes immediately in the statusbar, but I do not know how to access it with firefox 3. I have tried window.content.status , but it is not working. Any help would be appreciated. BTW. Thank you Stilgar for FF.au3. You are awesome. Link to comment Share on other sites More sharing options...
trinitrotoluen Posted March 9, 2009 Share Posted March 9, 2009 What did you mean with "wrong query"? A query that found nothing or a query with a wrong expression?If you try this: _FFXPath($Socket,"qwert")there's nothing wrong, but the expression can't find anything.If you try this:_FFXPath($Socket,"////")then you run into an error, because that's an illegal expression.If've tried many many things with it and I never have a problem with it, IF you use the right return types and XPath queries.You can look for examples there:Evaluate examples with greasemonkeyI see, It works fine now When I test with multiple profiles, above 20 profiles at the sametime, there's some issues with _FFXpath and _FFSearch. _FFXpath hang on and _FFSearch couldn't find a string. They don't happen often so I haven't recorded them yet, When they happend again I will log them.Good work ! Link to comment Share on other sites More sharing options...
Stilgar Posted March 9, 2009 Share Posted March 9, 2009 @drdave:Thank you!You can try it instead of the status text with the nsIWebProgress interface of FireFox, e.g. with the commands:_FFSetGet($Socket,"window.getBrowser().webProgress.busyFlags")_FFSetGet($Socket,"window.getBrowser().webProgress.isLoadingDocument")@trinitrotoluen:How did you use _FFXpath if it "hangs"?Have you tried to change the $iDelay parameter (the last one) for _FFSearch ? jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
drdave Posted March 12, 2009 Share Posted March 12, 2009 @drdave:Thank you!You can try it instead of the status text with the nsIWebProgress interface of FireFox, e.g. with the commands:_FFSetGet($Socket,"window.getBrowser().webProgress.busyFlags")_FFSetGet($Socket,"window.getBrowser().webProgress.isLoadingDocument")@trinitrotoluen:How did you use _FFXpath if it "hangs"?Have you tried to change the $iDelay parameter (the last one) for _FFSearch ?Thanks Stilgar. I am able to get access to the loading page in 0.3 seconds using nsIWebProgress. Appreciated. Link to comment Share on other sites More sharing options...
trinitrotoluen Posted March 12, 2009 Share Posted March 12, 2009 With _FFXpath we can get string via query. Is it possible to get Xpath query via string ?How do I use nsIWebProgress ? I've read this link : https://developer.mozilla.org/en/nsIWebProgress but I can't understand.Many thanks ! Link to comment Share on other sites More sharing options...
Stilgar Posted March 12, 2009 Share Posted March 12, 2009 (edited) @trinitrotoluen: Can you show me an example what do you tried to do? Have you looked at the examples in the docu?: #Include <Array.au3> #Include <FF.au3> $Socket = _FFConnect() If $Socket > -1 Then _FFTabAdd($Socket, "http://ff-au3-example.thorsten-willert.de/") MsgBox(64, "Number of password fields:", _FFXPath($Socket, "//input[@type='password']", "", 1)) MsgBox(64, "Fieldset-Legend:", _FFXPath($Socket, "//form[@id='Programmiersprache']/fieldset/legend")) MsgBox(64, "Text from 0ption 5:", _FFXPath($Socket, "//option[5]")) $vTmp = "Method: " & _FFXPath($Socket, "//form[2]/@method") & @crlf $vTmp &= "Action: " & _FFXPath($Socket, "//form[2]/@action") MsgBox(64, "Form 2", $vTmp) $aArray = _FFXPath($Socket,"//option","value",7) _ArrayDisplay($aArray) EndIf I see the documentation for this interface is not really good. With: _FFSetGet($Socket,"window.getBrowser().webProgress.isLoadingDocument") can you check if a document is loading. With: _FFSetGet($Socket,"window.getBrowser().webProgress.busyFlags") can you check the current loading state. busyFlags are: BUSY_FLAGS_NONE = 0 BUSY_FLAGS_BUSY = 1 BUSY_FLAGS_BEFORE_PAGE_LOAD = 2 BUSY_FLAGS_PAGE_LOADING = 4 Edited March 12, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
trinitrotoluen Posted March 12, 2009 Share Posted March 12, 2009 Thank Stilgar for the ex of nsIWebProgress Can you show me an example what do you tried to do?for ex : I have the string : "Number of password fields", I wanna get the Xpath query for this string.Of course I can do it with Xpather, but I wanna ask if there's a way to do with coding. Link to comment Share on other sites More sharing options...
Stilgar Posted March 12, 2009 Share Posted March 12, 2009 (edited) Ok you have the string "Number of password fields" what you wanna do then with xpath? Xpath is usefull if you know e.g. the id of an div and you would get the text of it: <div id='id2'>text</div> => $sDivText = _FFXpath($Socket,"//div[@id='id2']") or you can set an value: _FFXPath($Socket,"//textarea[@name='sonderangaben']","value='Number of password fields'",5) ... Edited March 12, 2009 by Stilgar jEdit4AutoIt PlanMaker_UDF Link to comment Share on other sites More sharing options...
Authenticity Posted March 12, 2009 Share Posted March 12, 2009 Hi Stilgar, thank you very much for this wonderful automation library. I've read your example to write inner HTML directly to the body. Can you give an example of how to write scratch HTML and thus release previous content of a page using FF.au3? I mean [html][...][/...][/html] etc.. Link to comment Share on other sites More sharing options...
Recommended Posts