网页操作:打开地址 http://search.jiayuan.com/v2/index.php?sex=m&stc=1:44,2:18.28,23:1&f=search
get http://search.jiayuan.com/v2/index.php?sex=m&stc=1:44,2:18.28,23:1&f=search
post http://search.jiayuan.com/v2/search_v2.php
[C#] 纯文本查看 复制代码 string myCookie = "";
HttpHelper myhttp = new HttpHelper();
HttpItem myitem = null;
HttpResult myresult = null;
myitem = new HttpItem();
myitem.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
myitem.Header["Accept-Language"] = "zh-CN,zh;q=0.8";
myitem.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1";
myitem.Header["Accept-Encoding"] = "gzip,deflate,sdch";
myitem.Header["Accept-Charset"] = "GBK,utf-8;q=0.7,*;q=0.3";
myitem.KeepAlive = true;
myitem.URL = "http://search.jiayuan.com/v2/index.php?sex=m&stc=1:44,2:18.28,23:1&f=search"; //URL 必需项
myitem.Method = "get";
//myitem.Cookie = _cookie;
//得到HTML代码
myresult = new HttpResult();
myresult = myhttp.GetHtml(myitem);
myCookie = myresult.Cookie;
//获取内容
myhttp = new HttpHelper();
myresult = null;
myitem = new HttpItem();
myitem.Accept = "*/*";
myitem.Referer = "http://search.jiayuan.com/v2/index.php?sex=m&stc=1:44,2:18.28,23:1&f=search";
myitem.Header["Accept-Language"] = "zh-CN,zh;q=0.8";
myitem.UserAgent = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1";
myitem.Header["Accept-Encoding"] = "gzip,deflate,sdch";
myitem.Header["Accept-Charset"] = "GBK,utf-8;q=0.7,*;q=0.3";
myitem.KeepAlive = true;
myitem.URL = "http://search.jiayuan.com/v2/search_v2.php";//URL 必需项
myitem.Method = "post";
myitem.Postdata = "sex=m&key=&stc=1%3A44%2C2%3A18.28%2C23%3A1&sn=default&sv=1&p=1&f=search&listStyle=bigPhoto&pri_uid=0&jsversion=v5";
myitem.Cookie = myCookie;
//得到HTML代码
myresult = new HttpResult();
myresult = myhttp.GetHtml(myitem);
myCookie = myresult.Cookie;
richTextBox1.Text = myresult.Html;
程序出来的结果与IE浏览的不对,而且按程序出来的结果去查,也是不对的(地区性别身高等,下面颜色部分是ID)
http://www.jiayuan.com/17759022?fxly=search_v2_id
大家围观一下看是哪里出了问题??
|