langthang084 Posted November 30, 2014 Share Posted November 30, 2014 (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 November 30, 2014 by langthang084 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 30, 2014 Moderators Share Posted November 30, 2014 (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 November 30, 2014 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 More sharing options...
Iczer Posted November 30, 2014 Share Posted November 30, 2014 I'm using modified version, but in original _IELoadWait() always hung in case of unknown error - see closed "works for me" bug #2711 Link to comment Share on other sites More sharing options...
langthang084 Posted November 30, 2014 Author Share Posted November 30, 2014 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 More sharing options...
langthang084 Posted November 30, 2014 Author Share Posted November 30, 2014 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 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 30, 2014 Moderators Share Posted November 30, 2014 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now