Sabai Posted September 11, 2014 Share Posted September 11, 2014 I am just trying to navigate to many different websites but it appears as if the IE object is getting lost after going to anywhere from 1 to 8 sites. The browser stops redirecting, and after few minutes I finally get the MsgBox error. This is happening for me in Windows 7/IE 11 and Windows 8.1 IE11. #include <File.au3> #include <Array.au3> #include <IE.au3> $sSites = "news.google.com,yahoo.com,bing.com,amazon.com,nextag.com,craigslist.org,newegg.com,shopping.com,dealtime.com,thefind.com,pricewatch.com,hautelook.com,ideeli.com,dealspl.us,dealnews.com,pronto.com,etsy.com" $aMerchList = StringSplit(StringStripWS(StringStripCR($sSites), $STR_STRIPALL), ",") $cNumMerchants = UBound($aMerchList) - 1 $oIE = _IECreate() If @error Then MsgBox(0, "Error", "There was a problem opening IE! Closing application.") Exit EndIf Sleep(3000) ; For each merchant in the file, send each URL through the browser. For $i = 1 To $cNumMerchants ; THIS IS WHERE AUTOIT LOSES THE CONNECTION TO BROWSER AFTER ~2-3 URLS _IENavigate($oIE, $aMerchList[$i]) If @error Then MsgBox(0, "Error", "There was a problem opening webpage!") EndIf Next _IEQuit($oIE) Link to comment Share on other sites More sharing options...
j0kky Posted September 11, 2014 Share Posted September 11, 2014 2 issues: - you don't need to Ubound($aMerchList) because the first element of $aMerchList is the total number of elements - change: MsgBox(0, "Error", "There was a problem opening webpage!") with: MsgBox(0, "Error", "There was a problem opening webpage: " & @error) And write here the output. Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
Sabai Posted September 11, 2014 Author Share Posted September 11, 2014 The first error returned after the long wait is the number 6, output being "There was a problem opening webpage: 6". Then there are multiple errors for the remaining sites, that error is the number 2 for each. From help, the error status codes correspond to: 6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout 2 ($_IEStatus_COMError) - COM Error in Object reference Link to comment Share on other sites More sharing options...
j0kky Posted September 11, 2014 Share Posted September 11, 2014 Try to add Sleep(500) after _IENavigate Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
Sabai Posted September 11, 2014 Author Share Posted September 11, 2014 Thanks for the suggestion but no luck, tried longer sleep times between navigates as well Can others running this see the same timeout happening? I am seeing it in multiple OSes so I would think it is not just me but i can't believe others aren't seeing this and I searched for this issue before posting. Link to comment Share on other sites More sharing options...
j0kky Posted September 12, 2014 Share Posted September 12, 2014 I've tested you script and I get no errors. Which version of IE and Autoit do you have? Spoiler Some UDFs I created: Winsock UDF STUN UDF WinApi_GetAdaptersAddresses _WinApi_GetLogicalProcessorInformation Bitwise with 64 bit integers An useful collection of zipping file UDFs Link to comment Share on other sites More sharing options...
Sabai Posted September 12, 2014 Author Share Posted September 12, 2014 IE is version 11.0.9600.17207 AutoIT (SciTE) is version 3.4.4 I am using this script in both VMWare and on my development machine and I get timeouts in all environments. Not sure WTH is going on. Link to comment Share on other sites More sharing options...
MikahS Posted September 12, 2014 Share Posted September 12, 2014 not SciTE, the version of AutoIt you are using, like 3.3.8.1 or 3.3.12.0 Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Sabai Posted September 18, 2014 Author Share Posted September 18, 2014 Found it, AutoIT is version 3.3.12.0. I understand there are no errors, but could someone run the script and verify they get timeouts as well or does it complete the script? Just want to make sure it is not my environment. Link to comment Share on other sites More sharing options...
MikahS Posted September 18, 2014 Share Posted September 18, 2014 (edited) worked for me with this: For $i = 1 To $cNumMerchants ; THIS IS WHERE AUTOIT LOSES THE CONNECTION TO BROWSER AFTER ~2-3 URLS sleep(4000) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< added this to give time between navigations _IENavigate($oIE, $aMerchList[$i]) If @error Then MsgBox(0, "Error", "There was a problem opening webpage!") EndIf Next Edited September 18, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Sabai Posted September 18, 2014 Author Share Posted September 18, 2014 Strange, still does not work for me, I get the timeout after it hits the third URL every time, I have changed the third URL, I have tried it on clean VM machines both 32- and 64-bit, I am just bumfuzzled. Can no one else see the timeout on the third URL?!? Maybe I will try an older version of AutoIT, I never seemed to have this problem before updating. Mikah are you on an older version of AutoIT? Link to comment Share on other sites More sharing options...
MikahS Posted September 18, 2014 Share Posted September 18, 2014 Adjust the sleep, I had to make sure every page loaded completely before it would navigate to the next. Try intervals of different sleep commands such as: 4000, 5000, 6000. Nope I am latest and greatest Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
vuathamlam Posted December 8, 2014 Share Posted December 8, 2014 i get same error... how to fix it Link to comment Share on other sites More sharing options...
MikahS Posted December 8, 2014 Share Posted December 8, 2014 Have you tried my code with the adjusted sleep intervals? Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
jdelaney Posted December 8, 2014 Share Posted December 8, 2014 I've seen issues with _iecreate, where mutliple instances are being opened. Sometimes, the process isn't completely closed, causing future ones to not open. Kill all the processes, or don't _iequit, and instead just navigate to the next url with the known IE. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
DaleHohm Posted December 10, 2014 Share Posted December 10, 2014 The SLEEP() suggestions will not help you in any way. The important message is 6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout. This means that _IENavigate waited 5 minutes for one of the sites to finish loading and it didn't. Internally, it is waiting for the document ReadyState to change to 4 or "completed" - you may actually see HTML rendered in the browser, but it still thinks it is waiting for more information from the web server. You can circumvent this default behavior in _IENavigate (it is actually a behavior of _IELoadWait that _IENavigate and many other _IE functions call for you) by passing the NoWait flag to _IENavigate and then putting in your own logic to see if the browser page is ready to work with. _IELoadWait also has a configurable timeout value that you can set... see the helpfile. All that said, what jdelaney suggests is also prudent. 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 Link to comment Share on other sites More sharing options...
MikahS Posted December 10, 2014 Share Posted December 10, 2014 (edited) I've seen issues with _iecreate, where mutliple instances are being opened. Sometimes, the process isn't completely closed, causing future ones to not open. Kill all the processes, or don't _iequit, and instead just navigate to the next url with the known IE. As you can see, I wasn't closing anything. As you said, navigating to the next url with the known IE. For $i = 1 To $cNumMerchants ; THIS IS WHERE AUTOIT LOSES THE CONNECTION TO BROWSER AFTER ~2-3 URLS sleep(4000) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< added this to give time between navigations _IENavigate($oIE, $aMerchList[$i]) If @error Then MsgBox(0, "Error", "There was a problem opening webpage!") EndIf Next The SLEEP() suggestions will not help you in any way. The important message is 6 ($_IEStatus_LoadWaitTimeout) - Load Wait Timeout. This means that _IENavigate waited 5 minutes for one of the sites to finish loading and it didn't. Internally, it is waiting for the document ReadyState to change to 4 or "completed" - you may actually see HTML rendered in the browser, but it still thinks it is waiting for more information from the web server. You can circumvent this default behavior in _IENavigate (it is actually a behavior of _IELoadWait that _IENavigate and many other _IE functions call for you) by passing the NoWait flag to _IENavigate and then putting in your own logic to see if the browser page is ready to work with. _IELoadWait also has a configurable timeout value that you can set... see the helpfile. All that said, what jdelaney suggests is also prudent. Dale Is this because of the server thinking that it is not completed loading or your _IE functions think it is not loaded? EDIT: Also, using _IELoadWait() is just doing what _IENavigate is suppose to do (but can't it seems), and setting the timeout is like setting a sleep() command, as in stopping the script until the desired amount of time has been hit, or the page has loaded, sleep just does not account for the page being loaded and just waits the full amount of time. Edited December 10, 2014 by MikahS Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 10, 2014 Moderators Share Posted December 10, 2014 Is this because of the server thinking that it is not completed loading or your _IE functions think it is not loaded? EDIT: Also, using _IELoadWait() is just doing what _IENavigate is suppose to do (but can't it seems), and setting the timeout is like setting a sleep() command, as in stopping the script until the desired amount of time has been hit, or the page has loaded, sleep just does not account for the page being loaded and just waits the full amount of time. I'm so confused on what you're asking here... Just take a look at the UDF function, it does do a loop, it does set a timer if necessary, it even double checks. That has nothing to do with the functions, but everything to do with the IE objects current state. 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...
MikahS Posted December 10, 2014 Share Posted December 10, 2014 Well your confusion gave me the answer to the question. I'll bow out of this, as I can tell my lack of experience and knowledge is getting in the way. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted December 10, 2014 Moderators Share Posted December 10, 2014 Well your confusion gave me the answer to the question. I'll bow out of this, as I can tell my lack of experience and knowledge is getting in the way. Never bow out of a question if you have something that you feel may help. I was just confused on what you were asking, and the bold was to iterate what I thought you might be confused on. 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