请帮小弟我看看,curl获取不了内容
程序员文章站
2024-04-06 08:51:13
...
请帮我看看,curl获取不了内容
我直接访问链接是可以得到信息的,用curl获取就获取不了。请问哪里设置不对??
------解决思路----------------------
curl_getinfo();
Array
(
[url] => https://sellercentral.amazon.co.jp/hz/fba/profitabilitycalculator/productmatches?searchKey=B00F9520K4&language=ja_JP&profitcalcToken=OU5j2BenHp1umrO6zigDVeiYOYwdAj3D
[content_type] => text/html;charset=UTF-8
[http_code] => 500
[header_size] => 525
[request_size] => 311
[filetime] => -1
[ssl_verify_result] => 20
[redirect_count] => 0
[total_time] => 0.953
[namelookup_time] => 0
[connect_time] => 0.218
[pretransfer_time] => 0.671
[size_upload] => 0
[size_download] => 2252
[speed_download] => 2363
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0.953
[redirect_time] => 0
[certinfo] => Array
(
)
[primary_ip] => 54.240.252.167
[primary_port] => 443
[local_ip] => 192.168.1.5
[local_port] => 1913
[redirect_url] =>
)
估计你token过期了。
$url="https://sellercentral.amazon.co.jp/hz/fba/profitabilitycalculator/productmatches?searchKey=B00F9520K4&language=ja_JP&profitcalcToken=OU5j2BenHp1umrO6zigDVeiYOYwdAj3D";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $rul);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
echo $output = curl_exec($ch) ;
我直接访问链接是可以得到信息的,用curl获取就获取不了。请问哪里设置不对??
------解决思路----------------------
curl_getinfo();
Array
(
[url] => https://sellercentral.amazon.co.jp/hz/fba/profitabilitycalculator/productmatches?searchKey=B00F9520K4&language=ja_JP&profitcalcToken=OU5j2BenHp1umrO6zigDVeiYOYwdAj3D
[content_type] => text/html;charset=UTF-8
[http_code] => 500
[header_size] => 525
[request_size] => 311
[filetime] => -1
[ssl_verify_result] => 20
[redirect_count] => 0
[total_time] => 0.953
[namelookup_time] => 0
[connect_time] => 0.218
[pretransfer_time] => 0.671
[size_upload] => 0
[size_download] => 2252
[speed_download] => 2363
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => 0
[starttransfer_time] => 0.953
[redirect_time] => 0
[certinfo] => Array
(
)
[primary_ip] => 54.240.252.167
[primary_port] => 443
[local_ip] => 192.168.1.5
[local_port] => 1913
[redirect_url] =>
)
估计你token过期了。
相关文章
相关视频