/// <summary>
/// 过滤html标签
/// </summary>
/// <param name="html">html的内容</param>
/// <returns>处理后的文本</returns>
public static string StripHTML(string html)
//创建Httphelper对象
HttpHelper http = new HttpHelper();
//创建Httphelper参数对象
HttpItem item = new HttpItem()
{
URL = "http://www.sufeinet.com",//URL 必需项
Method = "get",//URL 可选项 默认为Get
ContentType = "text/html",//返回类型 可选项有默认值
//ContentType = "application/x-www-form-urlencoded",//返回类型 可选项有默认值
};
//请求的返回值对象
HttpResult result = http.GetHtml(item);
//获取请请求的Html
string html = result.Html;
html = HttpHelper.StripHTML(html);
温柔地杀了它 发表于 2018-1-22 22:01
能不能提取指定标签的HTML
欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |