我需要在页面上执行javascript后访问HTML文档的DOM.我有以下代码连接到URL并获取文档.问题是它在用javascript修改后永远不会得到DOM
public class CustomBrowser
{
public CustomBrowser()
{
//
// TODO: Add constructor logic here
//
}
protected string _url;
string html = "";
WebBrowser browser;
public string GetWebpage(string url)
{
_url = url;
// WebBrowser is an ActiveX control that must be run in a
// single-threaded apartment so create a thread to create the
// control and generate the thumbnail
Thread thread = new Thread(new ThreadStart(GetWebPageWorker));
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
string s = html;
return s;
}
protected void …Run Code Online (Sandbox Code Playgroud)