I solved the problem for me.
the key is, attaching a handler for onPropertyChanged
event of the div element which is being populated via ajax call.
HtmlElement target = webBrowser.Document.GetElementById("div_populated_by_ajax");
if (target != null)
{
target.AttachEventHandler("onpropertychange", handler);
}
and finally,
private void handler(Object sender, EventArgs e)
{
HtmlElement div = webBrowser.Document.GetElementById("div_populated_by_ajax");
if (div == null) return;
String contentLoaded = div.InnerHtml; // get the content loaded via ajax
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…