Cez Posted January 29, 2009 Posted January 29, 2009 How to detect when a web page is finished loading in IE?
BrettF Posted January 29, 2009 Posted January 29, 2009 Check out _IELoadWait(). Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
BrettF Posted January 29, 2009 Posted January 29, 2009 Hi, Is this your thread? No. You are hijacking this one. Take a look at FF.au3 (Search for it), it may have something in there. Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
weirddave Posted February 1, 2009 Posted February 1, 2009 (edited) the AU3 help file says _IELoadWait(). can get confused with some sites.Here's a bit of code I use, it's not great, but it gets the job done....Run ("C:\program files\internet explorer\iexplore.exe http://www.google.com/")If WinWait ("Google - Windows Internet Explorer","",5) = 1 Then For $a=1 to 10 Sleep (1000) If ControlGetText("Google - Windows Internet Explorer","","[CLASS:msctls_statusbar32; INSTANCE:1]") = "Done" Then Sleep(1000) If ControlGetText("Google - Windows Internet Explorer","","[CLASS:msctls_statusbar32; INSTANCE:1]") = "Done" Then $a=10 EndIf EndIf Next ;do stuffEndIf Edited February 1, 2009 by weirddave
weirddave Posted February 1, 2009 Posted February 1, 2009 Just to explain, since I can't get decent formatting to work so it looks a mess! 1:- It loads IE with google 2:- waits for the IE window with google in the title, times out after 5 secs 3:- iIf the window loads up, go into a for loop and check for done up to 10 times with a 1 second delay each time to give a 10 second timeout 4:- if we see done, wait 1 second and check again in case the page has decided to start loading more stuff. This can lead to an 11 second timeout....
techbard Posted February 2, 2009 Posted February 2, 2009 Use $sVar = _IEPropertyGet($oIE, "statustext") for better work?
weirddave Posted February 2, 2009 Posted February 2, 2009 Interesting! So I'd end up with: #include <IE.au3> $oIE = _IECreate ("http://www.google.com/") If WinWait ("Google - Windows Internet Explorer","",5) = 1 Then For $a=1 to 10 Sleep (1000) If _IEPropertyGet ($oIE, "statustext") = "Done" Then Sleep(1000) If _IEPropertyGet ($oIE, "statustext") = "Done" Then $a=10 EndIf EndIf Next ;do stuff EndIf Looking at IE.au3, I could replace: _IEPropertyGet($oIE, "statustext") with: $oIE.StatusText() I've kept the WinWait command for the moment, I need to think about checking @Error after _IECreate. I can't see an @Error result that tells me if IE actually loaded or not, General Error perhaps?
tonycst Posted June 12, 2015 Posted June 12, 2015 (edited) Neither of those examples are good.The one with _IECreate would (maybe) work, but no one wants to create anything but to use already existing page.The one with _IEPropertyGet is also useless, because not only new explorer does not say "Done" anymore but also when page says "Done" it does not mean its "Done".For example, there could be PDF file to display, so it will be "Done" then start downloading and when download complete, it will do another "Done" so technically its impossible to say when its "DONE" for sure because what ever content/code page runs will/could trigger status bar to turn into "Done" multiple times. I've seen this allot. There has to be a better way:Only when you want to detect specific pages you can use InetGet (download the page and do binary to string)Then read the string and search for (part of the code page ends with)If that part of the code exist, then page is loaded. Otherwise This wold only work if you specify pages to download and its not a real time thing. To make it real time, you'd have to download and convert binary to string multiple times. So many that server would probably ban you. There has to be another way.I my self looking for what ever that would help me identify element in the browser window and weather or not its ready and accepting input, so i can continue on barcode scanning Edited June 12, 2015 by tonycst
JohnOne Posted June 13, 2015 Posted June 13, 2015 Maybe you should expand your search to topics newer than 6 years old, I'm pretty certain this has been discussed every few months. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
tonycst Posted June 18, 2015 Posted June 18, 2015 6 years old still no answer I went into messing with _IECreate() fuction and came up with#include <GUIConstantsEx.au3> #include <IE.au3> $URL = "www.google.com" $Browser = _IECreate ($URL,1) _IEPropertySet ($Browser,"addressbar",0) _IEPropertySet ($Browser,"toolbar",0) $Done = 0 While 1 $Wait = _IELoadWait ($Browser) If $Wait = 1 and $Done = 0 Then MsgBox(0,'','loaded',1) Assign ("Done",1) EndIf ;How do i go about finding if page is changed or reloaded ? WEndIt works great (i would like to do it on already existing web browser) but i dont know how to detect it again if something changes.Any clues ?Thanks !
AlienStar Posted October 9, 2017 Posted October 9, 2017 can I detect if the page is loaded in firefox instead of internet explorer ???
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