Sign in to follow this  
Followers 0
langthang084

_IEloadwait problem

6 posts in this topic

#1 ·  Posted (edited)

I want to wait the website in 10s, if after 10s the website dont load complete then do some script.

Here's my code but it dont run correct. Could anyone help me to solve this problem

#include <ie.au3>

$IE = _IECreate("google.com", 0, 1, 0)
$wait = _IELoadWait($IE, 0, 10000)
if $wait = @error Then
    ...
 EndIf
$Read = _IEBodyReadText($IE)
Edited by langthang084

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Do you want us to guess why it doesn't run correctly?

Provide code that REPLICATES the issue, not pseudo code you're using.

Edit:

Wait, If $wait = @error ?

$wait contains the return code from _IELoadWait

$wait either equals 0 or 1, you're comparing it to:

0 ($_IEStatus_Success) - Success

1 ($_IEStatus_GeneralError) - General Error
3 ($_IEStatus_InvalidDataType) - Invalid Data Type
4 ($_IEStatus_InvalidObjectType) - Invalid Object Type
6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout
8 ($_IEStatus_AccessIsDenied) - Access Is Denied
9 ($_IEStatus_ClientDisconnected) - Client Disconnected

I would think it would simply be:

If @error Then

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

I'm using modified version, but in original _IELoadWait() always hung in case of unknown error - see closed "works for me" bug #2711

Share this post


Link to post
Share on other sites

Do you want us to guess why it doesn't run correctly?

Provide code that REPLICATES the issue, not pseudo code you're using.

Edit:

Wait, If $wait = @error ?

$wait contains the return code from _IELoadWait

$wait either equals 0 or 1, you're comparing it to:

0 ($_IEStatus_Success) - Success

1 ($_IEStatus_GeneralError) - General Error

3 ($_IEStatus_InvalidDataType) - Invalid Data Type

4 ($_IEStatus_InvalidObjectType) - Invalid Object Type

6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout

8 ($_IEStatus_AccessIsDenied) - Access Is Denied

9 ($_IEStatus_ClientDisconnected) - Client Disconnected

I would think it would simply be:

If @error Then

I use "If @error then" or "If $wait = 6 then" but it dont work

Share this post


Link to post
Share on other sites

I'm using modified version, but in original _IELoadWait() always hung in case of unknown error - see closed "works for me" bug #2711

sorry but I dont know how to use your code, where to put it to _IELoadWait() work correctly

Share this post


Link to post
Share on other sites

I use "If @error then" or "If $wait = 6 then" but it dont work

Again, $wait will NEVER equal 6.

$wait will only ever equal 0 or 1.  0 means it failed (0 = False), 1 means it succeeded (1 = True).

@error will only ever equal: 0, 1, 3, 4, 5, 6, 8, 9

At this point, I've no idea if it is your implementation of checking the value is done incorrectly, or if _IELoadWait is actually failing you.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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