|
string kw = Convert.ToString(keywordsarylist[0]);
HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.baidu.com/s?wd=" + kw + "&pn=10&oq=" + kw + "&tn=baiduhome_pg&ie=utf-8&usm=1",//URL 必需项
Method = "GET",//URL 可选项 默认为Get
IsToLower = false,//得到的HTML代码是否转成小写 可选项默认转小写
UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0",
Accept = "text/html, application/xhtml+xml, */*",// 可选项有默认值
ContentType = "text/html",//返回类型 可选项有默认值
Referer = "http://www.baidu.com",//来源URL 可选项
};
HttpResult result = http.GetHtml(item);
string respHtml = result.Html;
以上就是代码,我用的是万能框架dll,求各位大佬帮帮忙。
|
|