Problems in Waiting for Web page to Open
- From: "PaulFXH" <paul_hackett2@xxxxxxxxxxxx>
- Date: 8 Jun 2006 08:40:11 -0700
Hi
Inexperienced scripter building a small vbs script to allow hotkey
combo launching of a virus scanner that, without the script, would
require "mouse-clicking" through four different pages before the
scanner will start.
The script starts by launching IE and then calling the virus scanner
Start Page, waiting until the page is fully open, tabbing (via
SendKeys)to the appropriate button and Entering (via SendKeys).
The "waiting" in this step is done via:
While IE.ReadyState <> READYSTATE_COMPLETE : Wscript.Sleep tDoEvents
Wend
This brings up a EULA page where I would have liked to have used the
same While....Wend loop to wait until the page was fully open before
using the SendKeys function to "click" the Accept button and move to
the next page. However, use of the While....Wend loop causes the script
to stop and go no further. To overcome this, I have used instead a
Sleep command (WScript.Sleep 5000) whereupon it proceeds without
difficulty.
In the subsequent page, the scanner downloads updates for a time that
is quite variable depending chiefly on the days since the last update.
Once again, the While....Wend loop causes the script to stop while a 25
second Sleep, in its place, overcomes this problem in a somewhat
inelegant manner as perhaps as little as 2 seconds are necessary to
download the updates.
The final page allows choice of what is to be scanned. Here the
While....Wend loop works fine.
Although the script does what it is supposed to do, I`m puzzled as to
why the While....Wend loop works in only two of the four attempts to
incorporate it in this "macro".
Can anybody suggest what might be the problem here?
TIA
Paul
.
- Follow-Ups:
- Re: Problems in Waiting for Web page to Open
- From: Fosco
- Re: Problems in Waiting for Web page to Open
- Prev by Date: Re: Listview/HTA help please.
- Next by Date: Re: Releasing Field References Early
- Previous by thread: Script needed to search for long filenames
- Next by thread: Re: Problems in Waiting for Web page to Open
- Index(es):
Relevant Pages
|