|
1金钱
本帖最后由 sunny 于 2014-6-30 16:00 编辑
抓取淘宝旅行:http://trip.taobao.com的机票查询,用原抓包得来的数据可以正确返回,但用原数据只是改下日期参数:depDate却返回失败,返回:“本次请求并未返回任何数据”。可能与参数ua有关,不知参数:callback和ua的值是怎么来的?或是是否是其它问题,代码如下:
string url = "http://s.jipiao.trip.taobao.com/flight_search_result.htm?depCityName=%B9%E3%D6%DD&depCity=CAN&arrCityName=%B1%B1%BE%A9&arrCity=BJS&tripType=0&depDate=2014-07-08&arrDate=&searchBy=1277";
DotNet4.Utilities.HttpItem item = new DotNet4.Utilities.HttpItem()
{
URL = url,
Referer = "http://trip.taobao.com/jipiao/?spm=181.7091613.a1z68.6.aECWtg",
Host = "s.jipiao.trip.taobao.com",
ContentType = "text/html;charset=GB18030"
};
DotNet4.Utilities.HttpResult result = http.GetHtml(item);
string url1 = "http://s.jipiao.trip.taobao.com/searchow/search.htm?type=&depCity=CAN&depCityName=����&arrCity=BJS&arrCityName=����&depDate=2014-07-08&tripType=0&agentIds=&supplyItinerary=&autoBook=&cabinClass=&searchSource=99&searchBy=1277&passengerNum=&callback=YUI.Env.JSONP.yui_3_5_1_1_1404111774723_601&ua=052tpOWUuXBidH1MRVQp4Ln4pey54K3wuYx5g%3D%3D%7CtaBkcTQxdGF0YRRhJKGEgVY%3D%7CtJFV4sZQBo%2BGTrafx%2B7KDioy2t6Hb9c%2Fx75WUjtjSnPrE%2FvfGz9I0DhwiPHI7Dvs%7Cs6aDR2N2MzZzZnNmE2YjVtOmAwbix%2BK34peCx5LHUndCR1I3otfzJA%3D%3D%7Csqcy9kFEgPWwNfGEQGTzVExkXBRMaL9o%7CsSTgxOA3%7CsIVB9qOmYmejtpO20xdiR9IWAyZjRoLncvczJgNGY6fCt6J1og%3D%3D%7Cv6qva0%2F4jfhtGNwbPypval%2Faj9rvmv%2Fqryrj5gJ3QhdSF2LnwkdCVyInMgci5cEFEMfjNA%3D%3D%7Cvvs%2FiKyITAkceZ2o%2FWj9eC0YTVgNaE0Y3JmciW3o%2FWj9iO1obQhtKC1IjJnM2dwL3A%3D%3D%7Cvfj9%2BDw5%2FdgcCUxZnaj9iEw5XJitafzJDYhf";
item = new DotNet4.Utilities.HttpItem
{
URL = url1,
Referer = url,
Cookie = result.Cookie
};
result = http.GetHtml(item);
string html = result.Html; |
-
|