Jump to content

winwait using parsed HTML?


Recommended Posts

Ok...so my first script got put on hold for a while because something else came up.

I'm working on an autoinstaller for after I get a computer from an OEM manufacturer. I reinstall using my rather helpful 9-in-1 Windows XP disc, then install some apps depending on the needs of the user. I've got a TON of apps on there so far but I'm having trouble that is caused by the fact that autoit won't read the contents of a browser window. is this a limitation of the language, or can i do something to make it work?

what i want to do is have a winwait("", "blah blah blah") except the blah blah blah is in an application window that uses the IE engine to display the content (it's google updater...btw).

your help, as always, is appreciated

thanks

-overkill

Link to comment
Share on other sites

You want to learn the IE.au3 UDF from Dale Hohm. Those functions are now included in the current production version of AutoIt: 3.2.4.1

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

After reading the info on the appropriate functions, I can't figure out how I'm supposed to use a browser window that exists within a non-browser program.

I could just sleep for a bit, and then exit out of google updater and let it finish itself in the tray...and I'm thinking that's much easier :)

I'm also trying to figure out how to use winwaitactive with IEbodyreadtext without a middleman...anybody got some of that sexy sample code you guys write so well? :D

Thanks

Overkill

Link to comment
Share on other sites

If it is an embedded IE control, look at _IEAttach with the "embedded" parameter to get a reference to it.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

tell me if this looks right to you, and if not, what I should do to change it :)

While Not _IEAttach("done installing", "embedded") = 0
    sleep(10000)
WEnd

If _IEAttach("done installing", "embedded") = 0 Then
    Send("!{F4}")
    WinWaitClose("Google Updater")
EndIf

-Overkill

Link to comment
Share on other sites

More like this I think:

$oIE = ""
While Not IsObj($oIE)
    $oIE = _IEAttach("done installing", "embedded")
    Sleep(10000)
Wend

You really only need the _IEAttach is you need to operate on the contents of the browser however. If everything is based just on window existence, you can just use the standard Win* functions.

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Well here's what I'm trying to do with it:

I'm making a program that auto-installs software with an autoit script. After I run the google updater component, i want to close google updater and continue with the rest of the script using the "standard win* functions". however, i want GU to finish its task before i continue on to the next part of the script. So...when the browser window says "done installing", i want it to close the window and run the next function on the list.

Edited by Overkill
Link to comment
Share on other sites

If you have no need to fill out web forms or activate web links etc, then IE.au3 would be more complexity than you need.

Looks like you should be able to do all that with WinExists and WinClose

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

only problem is that the "done installing" part isn't in text that win functions can read.

example:

if i wanted to open this page via script, and use winwait("", "If you have no need to fill out web forms"), it wouldn't work because there is no "visible text".

Link to comment
Share on other sites

Oh, OK.

Then you need (looping and flow control left to you):

$oIE = _IEAttach("title of window that contains embedded IE control", "embedded")

$sBody = _IEBodyReadText($oIE)

If StringInStr($sBody, "done installing") Then <-- you found it

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

yay! progress!

Thanks, dale :)

Last question - does IE.au3 work with any browser, or just (as named) IE? I'm a FF fanboy, myself =)

I'm assuming no, but it doesnt hurt to ask :D If not, is there a FF.au3 out there? :D

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