Jump to content
Sign in to follow this  

IE - pause script until the browser loads a new page (NOT _IELoadWait()!!)

Recommended Posts


First off, I'm new to the autoit forums, so... Hi team!!

I'm attempting to write a script that uses IE.au3 heavily and would like to know how to get the script to wait until the browser loads a new page before resuming script. I don't simply mean _IELoadWait($oIE). I mean load page, execute script, and upon said unknown command, will hold until a the browser loads a page (by whatever means, ie. user manually mouse-clicking a link, or via the script navigating IE).

I've racked my brain for the last few days on this, and I can't come up with an elegant solution. Right now I have a While 1=1 loop cycling repeatedly analyzing/scraping the webpage, and it breaks down because the IE objects defined within the script are ill-defined once a user manually clicks a link.

I hope I explained that well. Let me know if you guys know any solutions for this pickle.


Share this post

Link to post
Share on other sites

If the browser $oIE is not loading anything and idling while waiting for user to manually click a link, then _IELoadWait($oIE) does nothing for me. I'm trying to find a way to hold/pause the script until the browser loads a new page.

Ie. sequence of events:

- webpage loads, completes, and idles

- autoit script reaches a function that waits for $oIE to load a NEW page.

- user manually clicks link

- new webpage loads

- script recognizes "aha! a new web page is loaded!" and resumes autoit script

Share this post

Link to post
Share on other sites

A couple of suggestions: 1) use _IEPropertyGet and poll for changes in locationurl or 2) use ObjEvent and set up and event trap for "onload". It would be nice if you'd explain what your application does, but what you are doing could be used for less than honerable pursuits.


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

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