Php cloudfront块卷曲请求
我有卷曲的问题。。。我想做的就是从网站上抓取统计数据。问题是cloudfront阻止了这个curl请求,我无法获取任何网站内容来获取数据。。。无论如何,我当前的curl代码:Php cloudfront块卷曲请求,php,curl,Php,Curl,我有卷曲的问题。。。我想做的就是从网站上抓取统计数据。问题是cloudfront阻止了这个curl请求,我无法获取任何网站内容来获取数据。。。无论如何,我当前的curl代码: $cookies = tempnam( sys_get_temp_dir(), 'CDL' ); // for cURL function getCurlData( $url, $data, $post = false, $http_build_query = false ) { global $cookies;
$cookies = tempnam( sys_get_temp_dir(), 'CDL' ); // for cURL
function getCurlData( $url, $data, $post = false, $http_build_query = false )
{
global $cookies;
$ch = curl_init();
curl_setopt( $ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT'] );
curl_setopt( $ch, CURLOPT_COOKIEFILE, $cookies );
curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookies );
curl_setopt( $ch, CURLOPT_TIMEOUT, 40000 );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_REFERER, $url );
if( $post )
{
curl_setopt( $ch, CURLOPT_POST, true );
if( $http_build_query )
{
curl_setopt( $ch, CURLOPT_POSTFIELDS, http_build_query( $data ) );
}
else
{
curl_setopt( $ch, CURLOPT_POSTFIELDS, $data );
}
}
$result = curl_exec( $ch );
curl_close( $ch );
return $result;
}
在这里,我提出一个请求:
$data= getCurlData( 'https://go.goptions.com/loginaffiliate/', 'command=logon&user=xxx&password=xxx', true );
回应是我的网站一直在刷新,当我检查html时,我看到:
<html><head><meta charset="utf-8"></head><body><script>window.rbzns = {fiftyeightkb: 43200000, days_in_week : 1};</script><script src="//d1a702rd0dylue.cloudfront.net/js/sugarman/v7/flat.js"></script><script>rbzns.challdomain="go.goptions.com"; rbzns.ctrbg="x3g/GqIS0Y9wYF6hDB2l7067JzcnwlLduB9x4jyL4f+kdAOxPRgRNdkm7uAiNOlc60AoVkIP+RqlM5u87rt4h/dwe2pLn7N6xYW0xhPGlGk5P84LS/fa3yX2VbPgMFDUDl5E1ofBO2IFyaZod0";rbzns.rbzreqid="cellexpertx-reblazer02313433393430309351276c9b6ba24778c"; winsocks(true);</script></body></html>
window.rbzns={fiftyeightkb:43200000,周内天数:1};rbzns.challdomain=“go.goptions.com”;rbzns.ctrbg=“x3g/gqis0y9wyf6hdb2l7067jzcnwldub9x4jyl4f+kdAOxPRgRNdkm7uAiNOlc60AoVkIP+RqlM5u87rt4h/dwe2pLn7N6xYW0xhPGlGk5P84LS/fa3yx2vbpgmfdudl5e1ofbo2fyazod0”;rbzns.rbzreqid=“cellexpertx-reblazer02313433393430309351276c9b6ba24778c”;winsocks(真);
是否可以跳过此云或其他内容以从该页面获取信息
谢谢。也许他们不喜欢你删除他们的内容……客户让我这么做,但不管怎样。。。有什么解决办法吗?别刮了。使用官方方法:嗯。。。我有点困惑。我不明白如何使用他们的API。。。你能解释一下我能理解的。。。在那个网站上我不明白