Jump to content

How to get ALL text in window


Recommended Posts

This is probably a stupid question, but here goes:

Why doesn't the window spy see the text of links on web pages?? As a simple

example, on the hiddensoft forum pages, there is a portion which reads: "Logged

in as: mark2004". What if I wanted to know which user was currently logged in

and wanted to process that information??? WinGetText() only returns limited text.

definitely not the text of all the links or the text of the posts etc.

BTW, another question I posted about searching a certain pixel location for text would probably solve this as well.

any help would be appreciated.

Mark

Link to comment
Share on other sites

This is probably a stupid question, but here goes:

Why doesn't the window spy see the text of links on web pages??  As a simple

example, on the hiddensoft forum pages, there is a portion which reads: "Logged

in as: mark2004".  What if I wanted to know which user was currently logged in

and wanted to process that information???  WinGetText() only returns limited text.

definitely not the text of all the links or the text of the posts etc.

The URLDownloadToFile() function will allow you to get the source of a web page, and then you can parse the page to get text, and links from the text by searching through the lines of the resulting downloaded file. Something like this:

;download the file
URLDownloadToFile("http://www.autoitscript.com/forum/index.php", @HomeDrive & "\temp\search.php")
$search = ""
;make a file pointer to the file
$file = FileOpen(@HomeDrive & "\temp\search.php", 0)
If $file = -1 Then Exit;error opening file

;search the file until the first occurance of the text you want
While $serach <> "my search string"
  $search = FileReadLine($file)
  If Abs($search) = 1 Then
    MsgBox(0, "Error", "Either the text was not found, or there was a file read error")
    Exit
  EndIf
WEnd

MsgBox(0, "String Found", "The string was found in the following line of text:" & @LF & $search)

;you could do more than display it, like take some other text around it
;and put that into a var, or whatever

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...