引用 这个类HtmlAgilityPack
最简单的写法
//声明
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
//加载页面
htmldoctd.LoadHtml(filePrintHttp);
获取input属性为name='remark'的 value 值
string remark = htmldoctd.DocumentNode.SelectSingleNode("//input[@name='remark']").GetAttributeValue("value", "");
点InnerHtml获取标签内容
获取table下tr1下td4 值
htmldoctds.DocumentNode.SelectSingleNode("//table/tr/td[4]").InnerText;
最简单的写法
//声明
HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
//加载页面
htmldoctd.LoadHtml(filePrintHttp);
获取input属性为name='remark'的 value 值
string remark = htmldoctd.DocumentNode.SelectSingleNode("//input[@name='remark']").GetAttributeValue("value", "");
点InnerHtml获取标签内容
获取table下tr1下td4 值
htmldoctds.DocumentNode.SelectSingleNode("//table/tr/td[4]").InnerText;