@kleinma:
I have some trouble determining the completed event.
Code:
' Load the url
Private Sub frmTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim orgurl As String = "url"
wb.Navigate(orgurl)
End Sub
'Document completed event
Private Sub webBrowser_DocumentCompleted(sender As Object, e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles wb.DocumentComplete
'Change the value in the txt box, and submit
DirectCast(GetCurrentWebDoc.getElementById("ctl00_mainContent_Live3Price1_NEW_wdcDate_dateInput_TextBox"), mshtml.HTMLInputElement).value = "22/06/2012"
DirectCast(GetCurrentWebDoc.getElementById("ctl00_mainContent_Live3Price1_NEW_Button1"), mshtml.HTMLInputElement).click()
'AFTER submit, content will be loaded. The submit button call AJAX to load data into table. Url unchanged.
'But the ready state already be "Complete"
'I'v tried WebBrowserReadyState.Complete and SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE , but get the same result, their state will be "Complete", even when browser still loading the content.
If wb.ReadyState = WebBrowserReadyState.Complete Then
MessageBox.Show("Done")
End If
End Sub
How to check if browser has completely loaded (after AJAX)?
I have to parse the source code (after AJAX), and need to check the state of browser