[C#] 纯文本查看 复制代码 HttpHelper http = new HttpHelper();
HttpItem item = new HttpItem()
{
URL = "http://www.baidu.com/link?url=_sERcBsTCgKElwFi7Hf9FVsM7Je48F6oFXsxpX_OJGzAdKsZCFKXSMVNVess4vhU&wd=&eqid=b346669000072f16000000035aa3d111",//URL 必需项
Method = "GET",//URL 可选项 默认为Get
Referer ="http://www.baidu.com/link?url=_sERcBsTCgKElwFi7Hf9FVsM7Je48F6oFXsxpX_OJGzAdKsZCFKXSMVNVess4vhU&wd=&eqid=b346669000072f16000000035aa3d111",//来源URL 可选项
Allowautoredirect = False,//是否根据301跳转 可选项
};
HttpResult result = http.GetHtml(item);
string html = result.Html;
string cookie = result.Cookie;
返回的Html如下
[HTML] 纯文本查看 复制代码 <meta content="always" name="referrer"><script>try{if(window.opener&&window.opener.bds&&window.opener.bds.pdc&&window.opener.bds.pdc.sendLinkLog){window.opener.bds.pdc.sendLinkLog();}}catch(e) {};var timeout = 0;if(/bdlksmp/.test(window.location.href)){var reg = /bdlksmp=([^=&]+)/,matches = window.location.href.match(reg);timeout = matches[1] ? matches[1] : 0};setTimeout(function(){window.location.replace("http://www.sufeinet.com/")},timeout);window.opener=null;</script>
<noscript><META http-equiv="refresh" content="0;URL='http://www.sufeinet.com/'"></noscript>
直接提取window.location.replace("http://www.sufeinet.com/")}的值就行了。
|