gloop Posted April 4, 2005 Share Posted April 4, 2005 (edited) I want to find a text in Mozilla an i use WinGetText. The Code looks so: $text = 0 If $text = WinGetText("Google", "Web ") THEN MsgBox(0, "Text read was:", $text) EndIf I don't understand why it's not function How can help me? Edited April 4, 2005 by gloop Link to comment Share on other sites More sharing options...
w0uter Posted April 4, 2005 Share Posted April 4, 2005 $text is not defined so you cannot use an IF statement. just use: $text = WinGetText("www.google.de");gets the text and writes it to the variable MsgBox(0, "Text read was:", $text);prints the variable $text My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
bshoenhair Posted April 4, 2005 Share Posted April 4, 2005 (edited) I beleive "WinGetText" in mozilla will always return "" not the page contents. Edited April 4, 2005 by bshoenhair Link to comment Share on other sites More sharing options...
sylvanie Posted April 4, 2005 Share Posted April 4, 2005 Hello, I'm not using Mozilla, but have you verify that "www.google.de" is the exact title of the window. For example, with SlimBrowser, it display "Google - SlimBrowser", but the real title of the window is "SlimBrowser - [Google]" (use Autoit Window info to check it) But really, the return value is not the same with different browsers (I have tested your example with IE and SlimBrowser) Link to comment Share on other sites More sharing options...
gloop Posted April 4, 2005 Author Share Posted April 4, 2005 (edited) Ive declared $text but not in the sample ... its not function with IE and with mozilla Edit: Google.de was a sample. I dont look with the correct title ... Edited April 4, 2005 by gloop Link to comment Share on other sites More sharing options...
sylvanie Posted April 4, 2005 Share Posted April 4, 2005 but not in the sample ... its not function with IEStrange, can you try with this code (it returns a value for me) :WinWaitActive("Google - Microsoft Internet Explorer") $text = WinGetText("Google - Microsoft Internet Explorer", "") MsgBox(0, "Text read was:", $text) Link to comment Share on other sites More sharing options...
gloop Posted April 4, 2005 Author Share Posted April 4, 2005 (edited) Now ive this code: $text = 0 Run("C:\Programme\Internet Explorer\IEXPLORE.EXE", "", @SW_MAXIMIZE) If WinWaitActive("Google - Microsoft Internet Explorer") THEN $text = WinGetText("Google - Microsoft Internet Explorer", "Web") MsgBox(0, "Text read was:", $text) Endif and it comes the messagebox and $text is 1 ...why not the text? When i gave a invalid text its the same result $text = 1 Edited April 4, 2005 by gloop Link to comment Share on other sites More sharing options...
SlimShady Posted April 4, 2005 Share Posted April 4, 2005 Replace "Web" with "" and try again. Link to comment Share on other sites More sharing options...
gloop Posted April 4, 2005 Author Share Posted April 4, 2005 But i will look if a word exist in the Browser. In the example i will search for "Web" :-/ Link to comment Share on other sites More sharing options...
bshoenhair Posted April 4, 2005 Share Posted April 4, 2005 (edited) Sorry but can't help you with SlimBrowser.. Edited April 4, 2005 by bshoenhair Link to comment Share on other sites More sharing options...
SlimShady Posted April 4, 2005 Share Posted April 4, 2005 But i will look if a word exist in the Browser.In the example i will search for "Web":-/<{POST_SNAPBACK}>This should definitely work. Post your current script. Link to comment Share on other sites More sharing options...
Ejoc Posted April 4, 2005 Share Posted April 4, 2005 (edited) I beleive "WinGetText" in mozilla will always return "" not the page contents.<{POST_SNAPBACK}>Checked it on my machine, and yea there's no text to be returned w/ Mozilla and WinGetTextDo you have:Opt("WinTitleMatchMode",2) ? Made finding windows much easier for meFYI: WinGetText() returns 1 if it doesnt find the window Edited April 4, 2005 by Ejoc Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
herewasplato Posted April 4, 2005 Share Posted April 4, 2005 But i will look if a word exist in the Browser.In the example i will search for "Web":-/<{POST_SNAPBACK}>Are you laboring under the impression that WinGetText will return with the entire contents of the webpage? I think that it will only return what can be seen via the AU3Info tools as >>>>>>>>>>> Visible Window Text <<<<<<<<<<<or>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<if the correct option is set.Maybe I'm wrong about the function WinGetText..... [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
gloop Posted April 5, 2005 Author Share Posted April 5, 2005 Now how can i find a text in a Browser??? Link to comment Share on other sites More sharing options...
bshoenhair Posted April 5, 2005 Share Posted April 5, 2005 Now how can i find a text in a Browser???<{POST_SNAPBACK}>Find text in a Browser or find text on a webpage ?A browser is only a program to view webpages. Link to comment Share on other sites More sharing options...
gloop Posted April 5, 2005 Author Share Posted April 5, 2005 Find text in a Browser or find text on a webpage ?A browser is only a program to view webpages.<{POST_SNAPBACK}>Find a text on a homepage Link to comment Share on other sites More sharing options...
bshoenhair Posted April 5, 2005 Share Posted April 5, 2005 Find a text on a homepage <{POST_SNAPBACK}>WinGetText will not work.You have two options that I can think of.1. Download page with InetGet then open the file and search for your text.2. I beleive the is a com related function that can do this but I can' think of it. Link to comment Share on other sites More sharing options...
gloop Posted April 6, 2005 Author Share Posted April 6, 2005 what is that for a crap function (WinGetText) ... i cant save all the time the website to search for a word :-/ it's not gave a function for that? Link to comment Share on other sites More sharing options...
Ejoc Posted April 6, 2005 Share Posted April 6, 2005 Blame the way Windows/Web Browser works, not AutoIt. Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs Link to comment Share on other sites More sharing options...
bshoenhair Posted April 6, 2005 Share Posted April 6, 2005 what is that for a crap function (WinGetText) ...i cant save all the time the website to search for a word :-/ it's not gave a function for that?<{POST_SNAPBACK}> What do you want a function for every browser since they all differ ? Get real, you have all the functions you need now. Use InetGet to save, then read the file. Link to comment Share on other sites More sharing options...
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