php curl amazon

golive 发布于 2013/06/03 17:55
阅读 1K+
收藏 0
<?php
header('content-type:text/html;charset=UTF-8');
include ("include/curlClass.php");
include ("include/simpledomClass.php");
$cookie_file=tempnam("./TEMP","cookie_z_cn.txt");


//登陆地址
$login_url='https://www.amazon.cn/ap/signin?ie=UTF8&pf_rd_r=1T2Z9MAJ7G0KXVC1Z2ZX&pf_rd_m=A1AJ19PSB66TGU&pf_rd_t=6301&pf_rd_i=cnflex&pf_rd_p=66012152&pf_rd_s=signin-slot';


$email=urldecode('137978759@qq.com');  //转码email

//POST信息
$post_fields  = array(
'appActionToken'=>'hihheyRRZCN7cHmYXykfVqVOPE4j3D',
'appAction'=>'SIGNIN',
'openid.pape.max_auth_age'=>'ape:MA==',
'openid.ns'=>'ape:aHR0cDovL3NwZWNzLm9wZW5pZC5uZXQvYXV0aC8yLjA=',
'openid.ns.pape'=>'ape:aHR0cDovL3NwZWNzLm9wZW5pZC5uZXQvZXh0ZW5zaW9ucy9wYXBlLzEuMA==',
'pageId:ape'=>'Y25mbGV4',
'openid.identity'=>'ape:aHR0cDovL3NwZWNzLm9wZW5pZC5uZXQvYXV0aC8yLjAvaWRlbnRpZmllcl9zZWxlY3Q=',
'openid.claimed_id'=>'ape:aHR0cDovL3NwZWNzLm9wZW5pZC5uZXQvYXV0aC8yLjAvaWRlbnRpZmllcl9zZWxlY3Q=',
'openid.mode:ape'=>'Y2hlY2tpZF9zZXR1cA==',
'ces:ape'=>'ZWpMNkZDYnhqZUZqeDZBeVl2R2JnWXA2Z1pqZXlEOFlEX2JETG9DZWJxNEZQU2ZtNnlvVTZzQUNEZnpoZHNKU2txbWFYNGs1V1FYSEZKMlg2TWFMS1ExaEVRSzcyTG5zSEs5YjRRMFlXNFE=',
'openid.assoc_handle'=>'ape:Y25mbGV4',
'openid.return_to'=>'ape:aHR0cHM6Ly93d3cuYW1hem9uLmNuL2dwL2Nzcy9ob21lcGFnZS5odG1sP2llPVVURjgmcmVmXz1nbm9feWFtX3lh',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DQ0Ln2Ry8R/0cHMg/GNDgE4Nft6J6lJqt4FT3RB/+VraPhaIzUEtsyTjmfedA6T/D5U1qbloyJ2zRKM0w/IRjpkBYn7zpm1o+CrXKK4iBtMfUQYau2drHBrn/6xEwLv6oVh9dfzIiIomzIuHws4mgbu0johbjPQexPaqxVi8UFV4cP4FsFnXPbY5sNOiBzVoQl9Fb83w/3HtTznTaXFe2IDwxG9l90100lg3OqvxaFAk+SnKwqRFovXjImzBD65rkh0ByljKljQmZROm1GWaQoz7nXcWq4TvcN3hkR2yGhqAlptVChjUJKD3tBiet6SZrOyv9RZGHfTfMfJThpDXmAIxZniIE9lhu9eWMyVELBtJlKf90NaUKJOeGTdWVXeMXObn96EYojT42YeER5pbBIREuREPxULFe5/YYF4CEY2GGDTY+4IB7A4GiUaL6/WolHofIFbEdT0Eoz4QgKQzVdfHB9WogA0vn4aZUXMymuoaZces8c5OoTGZ55FEPYM+JkbfgxAwQCa9FvT4ECnYccekK23SoFqrD+ZCRKV8GNEStzYjAokOH5gDNxCUcCtxpoUzQS9XVfCh+xF7kEE4yd4+zHMj56LaItCFsLJrLT6u0FkLK2aGjwXWY9DJV6uiaIGAwmc2HclT3BrmZHf4AfVv68qQDQspV3W2IJ2frWgjqGldHvHtt/7eV4roc/8UAU/6jkXE/WCxGtUzm266+FkWXqplw8kXrgb04PIa84Nm0rH+hZESn+lrwyKHhS+zmcItWEfaks3fZc6BU='
);
//模拟header
$headers = array(
'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding:gzip,deflate,sdch',
'Accept-Language:zh-CN,zh;q=0.8',
//'Cache-Control:max-age=0',
//'Connection:keep-alive',
//'Content-Length:2580',
//'Content-Type:application/x-www-form-urlencoded',
//'Host:www.amazon.cn',
//'Origin:https://www.amazon.cn',
//'Referer:https://www.amazon.cn/ap/signin?_encoding=UTF8&openid.assoc_handle=cnflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.cn%2Fgp%2Fyourstore%2Fhome%3Fie%3DUTF8%26ref_%3Dgno_signin',
//'User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36'
);


$mycurl=new CURL($cookie_file);

/********模拟登陆*********/
$content=$mycurl->vlogin($login_url,$post_fields,$headers);
var_dump($content);
/********模拟抓取*********/
//$content=$mycurl->vget($get_url,$headers);

//截取内容  
//$dom = new simpledomClass();
//echo $dom->getJingdongOrder($content);


?>

错误提示:

加载中
0
Youtubeornotobe
Youtubeornotobe
没这个简单的,亲
返回顶部
顶部