获取远程post查询后,抓取查询的数据。求教代码,帮帮忙400C币酬谢了;
已经有人找到接口了,只能是普通的旺旺号,换成商城旺旺或C店旺旺就查询不到了,估计是另一个接口,请求大家帮找一下另一个接口;
查询旺旺:top百分百 爱丽缇旗舰店
上面的接口就查不到数据了,如下图
获取远程post查询后,抓取查询的数据。求教代码,帮帮忙400C币酬谢了;
已经有人找到接口了,只能是普通的旺旺号,换成商城旺旺或C店旺旺就查询不到了,估计是另一个接口,请求大家帮找一下另一个接口;
查询旺旺:top百分百 爱丽缇旗舰店
上面的接口就查不到数据了,如下图
function escape($string, $in_encoding = 'UTF-8',$out_encoding = 'UCS-2') {
$return = '';
if (function_exists('mb_get_info')) {
for($x = 0; $x < mb_strlen ( $string, $in_encoding ); $x ++) {
$str = mb_substr ( $string, $x, 1, $in_encoding );
if (strlen ( $str ) > 1) { // 多字节字符
$return .= '%u' . strtoupper ( bin2hex ( mb_convert_encoding ( $str, $out_encoding, $in_encoding ) ) );
} else {
$return .=$str;// '%' . strtoupper ( bin2hex ( $str ) );
}
}
}
return $return;
}
$nick=escape('top百分百');
$taobaourl='http://wwwsoso002.taodake.com/taobao_data.php?callback=&nick=' .$nick .'&chkid=0&click=373635346667686A63786365&_=1422435566660';
$ch = curl_init();
curl_setopt($ch, CURLOPT_REFERER, 'http://www.taodake.com/');
curl_setopt($ch, CURLOPT_COOKIE, 'Hm_lvt_ebeb4888fc38c5c3a030f255b55395e3=1422448628; Hm_lpvt_ebeb4888fc38c5c3a030f255b55395e3=1422448800');
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36');
curl_setopt($ch, CURLOPT_URL, $taobaourl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$content = curl_exec($ch);
curl_close($ch);
$content=trim($content,'()');//去除首尾的括号,回调函数没传,所以不用理会了
$data = json_decode($content, true);
echo $data['b'];
这个是php版本的。。