Webbrowser与HtmlAgility的结合

神,这么复杂的标题~~
            HtmlAgilityPack.HtmlDocument htmlDocument = new HtmlAgilityPack.HtmlDocument();
            mshtml.HTMLDocument htmldocument = (mshtml.HTMLDocument)webBrowser.Document.DomDocument;
            string temp = htmldocument.documentElement.outerHTML;
            byte[] buffer = Encoding.GetEncoding(webBrowser.Document.Encoding).GetBytes(temp);
            MemoryStream ms = new MemoryStream(buffer);
            htmlDocument.Load(ms, Encoding.GetEncoding(webBrowser.Document.Encoding));

 

posted on 2013-01-09 10:41  雨渐渐  阅读(404)  评论(0编辑  收藏  举报

导航