시도한 file_get_contents,하지만 did'nt는 나에게 많은 것을 제공하지만 굳은 나를 위해 잘 작동하는 것처럼 보입니다.
당신은 당신의 서버에 설치 컬이 필요하고, PHP에 대한 libcurl에 확장,하지만 당신은 이런 식으로 뭔가를 시도하고 당신이 무엇을 얻을 볼 수있는 것 :
이 경우
<?php
$cl = curl_init();
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
$header[0] .= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
$header[] = "Cache-Control: max-age=0";
$header[] = "Connection: keep-alive";
$header[] = "Keep-Alive: 300";
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3";
$header[] = "Accept-Language: nb-NO,nb;q=0.8,no;q=0.6,nn;q=0.4,en-US;q=0.2,en;q=0.2";
$header[] = "Pragma: ";
curl_setopt($cl, CURLOPT_FAILONERROR,true);
curl_setopt($cl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7');
curl_setopt($cl, CURLOPT_HTTPHEADER, $header);
curl_setopt($cl, CURLOPT_REFERER, 'http://www.google.com');
curl_setopt($cl, CURLOPT_ENCODING, 'gzip,deflate');
curl_setopt($cl, CURLOPT_AUTOREFERER, false);
curl_setopt($cl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cl, CURLOPT_CONNECTTIMEOUT, 2);
$url = 'http://pinterest.com/source/google.com/';
curl_setopt($cl, CURLOPT_URL, $url);
$output = curl_exec($cl);
curl_close($cl);
?>
<!DOCTYPE html>
<head>
<title>get pinterest</title>
</head>
<body>
<xmp>
<?php echo $output; ?>
</xmp>
</body>
</html>
, 그것은되지 않습니다 당신은 전체 세션을 시뮬레이션하고 쿠키와 모든 것을 추적 할 필요가 있습니다. – miki
어렵지 않아야합니다. 첫 번째 요청에서 얻은 쿠키를 저장하고 추가 요청을 위해 쿠키를 보냅니다. 서버가 원한다면 헤더를 요청 전에 추가하여 '브라우저와 유사하게'만들 수 있습니다. – SuperSaiyan