.net中mshtml处理html的方法 1.添加引用.net 引用Microsoft.mshtml WebClient wc = new WebClient();wc.Encoding = Encoding.UTF8;string str = wc.DownloadString(@"//www.zwyuanma.com/web/73969.html"); HTMLDocumentClass doc = new HTMLDocumentClass();//获取html对象doc.designMode = "on"; //不让解析引擎去尝试运行javascriptdoc.IHTMLDocument2_write(str);把html 文档写入html对象中doc.close();关闭写流Console.WriteLine(doc.title);输出标题Console.WriteLine(doc.body.innerText); 输出bodyConsole.ReadKey();