如何使用CURL采集CNZZ数据
$cookie_file = tempnam('./wei1','wei');
$login_url = 'http://web.umeng.com/main.php?c=user&a=login';
$post_fields ='username=88888&password=123456';
$ch = curl_init($login_url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
$arr=curl_exec($ch);
curl_close($ch);
$url='https://web.umeng.com/main.php?siteid=1256657021&c=flow&a=trend&ajax=module=flash&st=2016-08-09&et=2016-08-09&type=Line&Period=Hour&Quota=pv&_=1470735753213';
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
$contents = curl_exec($ch);
echo $contents;
curl_close($ch);
这样写有什么不对吗,都登录不上CNZZ, 是怎么回事?