解析政策源码
1,正则获取:
Regex regex = new Regex(strPattern, RegexOptions.IgnoreCase | RegexOptions.Multiline); if (regex.IsMatch(htmlContent)) { MatchCollection matchCollection = regex.Matches(htmlContent); foreach (Match match in matchCollection) { string value = match.Value;//获取到的 } }
2,HtmlAgilityPack 之 HtmlNode类 (主要是XPath语法解析,firebug插件可以查看对应XPath)
这里下载:http://www.newtonsoft.com/products/json/
时间: 2024-10-07 02:30:31