Waiting for WebBrowser ajax content

前端 未结 4 1288
感动是毒
感动是毒 2021-02-14 14:21

I want to pause the execution of my thread until a particular div has been loaded via ajax into a WebBrowser instance. Obviously I can continuously check for the presence of thi

4条回答
  •  失恋的感觉
    2021-02-14 14:59

    The following should work,

    while (Browser.Document.GetElementById("divid") == null) 
    { 
        Application.DoEvents();
        Thread.Sleep(200); 
    }
    

    The above worked for me...

提交回复
热议问题