Jump to content

_IEloadwait problem


Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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.

Link to comment
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

Link to comment
Share on other sites

  • Moderators

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.

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