Get ReadyState from WebBrowser control without DoEvents

Below is a basic WinForms app code, illustrating how to wait for the DocumentCompleted event asynchronously, using async/await. It navigates to multiple pages, one after another. Everything is taking place on the main UI thread. Instead of calling this.webBrowser.Navigate(url), it might be simulating a form button click, to trigger a POST-style navigation. The webBrowser.IsBusy async … Read more

Failproof Wait for IE to load

Try this one, it helped me to solve similar problem with IE once: Set oIE = CreateObject(“InternetExplorer.application”) oIE.Visible = True oIE.navigate (“http://technopedia.com”) Do While oIE.ReadyState = 4: WScript.Sleep 100: Loop Do While oIE.ReadyState <> 4: WScript.Sleep 100: Loop ‘ example ref to DOM MsgBox oIE.Document.GetElementsByTagName(“div”).Length UPD: Drilling down IE events I found that IE_DocumentComplete is … Read more

What do the different readystates in XMLHttpRequest mean, and how can I use them?

The full list of readyState values is: State Description 0 The request is not initialized 1 The request has been set up 2 The request has been sent 3 The request is in process 4 The request is complete (from https://www.w3schools.com/js/js_ajax_http_response.asp) In practice you almost never use any of them except for 4. Some XMLHttpRequest … Read more