Sign in to follow this  
Followers 0
PsycoWiLL

Wait till page loaded

5 posts in this topic

hi, i self solved my other problem, but i came to a dead end:

how can i make it so my script waits till a page is loaded? i dont wanna do a simple Sleep() call and guess a time

thx in advance

Share this post


Link to post
Share on other sites



This was mention in another topic very recently... You have to options I know of. You can use PixelGetColor() to get the color of a pixel of the website. That way you can see if its loaded or not. Disadvantages is each computer its run on may have a different browser/browser resolution/screen resolution etc. As you can see its only good for personal use. The seconds option is to use StatusBarGetText(), look it up in the helpfile. It has an example with IE but it can also be used for other browsers :(.


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

And there is a third option with COM (with 3.1.1++). For IE:

Const $URL = "http://your-location"
$ObjIE=ObjCreate("InternetExplorer.Application")

With $ObjIE
  .Visible = True
  .Navigate($URL)
  Do; Idle until page load is complete
    Sleep(50)
  Until .ReadyState = 4
EndWith

;your code here

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

But you can't do that with FireFox right?

<{POST_SNAPBACK}>

Correct. No COM interface for FireFox. There should be ways to do this by tapping into the DOM object model, but I have not attempted 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

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