Jump to content

Extracting text from an explorer window


Guest Tony
 Share

Recommended Posts

I downloaded AutoIt a few hours ago and it is very easy

to use. Hence, I am probably just missing the obvious.

I am trying to read/extract text from an Internet Explorer webpage

window and having no luck at all.

The text is visible. I see it when I view source.

I can even cut and paste it.

Whenever I try to use WinGetText it does not return

all the data on screen. In fact, just returns the URL a

couple times.

fiddled with the WinSearchChildren and WinDetectHiddenText

options. Same thing.

AU3_spy does not show the text either.

Tried on multiple websites because I thought maybe unique

problem to website I am trying to script. Same thing.

Any help would be greatly appreciated

Tony

Edited by Tony
Link to comment
Share on other sites

Guest Guidosoft

Before I answer this, are you trying to simply catch a web page or do you need it to be in the browser. If you just want to catch a friken page you just do:

UrlDownloadToFile($Url,$FileName)

in the meantime, I will be searching for the solution to extracting the page from an explorer window.

Link to comment
Share on other sites

Not on a Windows machine right now, but (not real code, but the idea)

Click on the web page. Pick a spot or just use the coordinates from WinGetPos and add to the x and y. Or SetFocus or CntrlClick or whatever the command is, then

Send("^a^c")

$page = ClipGet()

Should work....

Link to comment
Share on other sites

  • 1 month later...

Not on a Windows machine right now, but (not real code, but the idea)

Click on the web page.  Pick a spot or just use the coordinates from WinGetPos and add to the x and y.  Or SetFocus or CntrlClick or whatever the command is, then

Send("^a^c")

$page = ClipGet()

Should work....

<{POST_SNAPBACK}>

I know this thread is a bit dated, but I'm having the same problem. The "^a^c" approach works OK some of the time but not always. The problem I'm encountering is that if the page has a form the carret can be in a form field so that "^a^c" copies the default content of the field, not the text of the page.

Send("{TAB}") to get out of the form doesn't work since it is not possible in general to know how big the form is nor to know when you get to the form's send control since IE doesn't use standard controls.

Moving the mouse somewhere on the page and clicking is a bit dodgy since it is not possible to know if the target location is a hot link.

View source might be attractive unless the page has frames.

Is there a bulletproof way to get the text to the clipboard?

Richard

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...