Sign in to follow this  
Followers 0
gloop

WinGetText

20 posts in this topic

#1 ·  Posted (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 by gloop

Share this post


Link to post
Share on other sites



$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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I beleive "WinGetText" in mozilla will always return "" not the page contents.

Edited by bshoenhair

Share this post


Link to post
Share on other sites

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)


Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by gloop

Share this post


Link to post
Share on other sites

but not in the sample ... its not function with IE

Strange, 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)

Share this post


Link to post
Share on other sites

#7 ·  Posted (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 by gloop

Share this post


Link to post
Share on other sites

Replace "Web" with "" and try again.

Share this post


Link to post
Share on other sites

But i will look if a word exist in the Browser.

In the example i will search for "Web"

:-/

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Sorry but can't help you with SlimBrowser..

Edited by bshoenhair

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#12 ·  Posted (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 WinGetText

Do you have:

Opt("WinTitleMatchMode",2) ? Made finding windows much easier for me

FYI: WinGetText() returns 1 if it doesnt find the window

Edited by Ejoc

Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

Now how can i find a text in a Browser???

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 ?

:D Get real, you have all the functions you need now.

:D Use InetGet to save, then read the file.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0