왜이 cURL 코드가 Pinterest에 로그인하지 않습니까?어떻게 pURL 로그인 하시겠습니까?
http://www.pinterest.com/login/
으로 설정하면 출력은 페이지를로드하지만, 내가 https
으로 설정하면 지난 7 시간 동안 페이지를 찾을 수없는 이유로이 오류가 표시됩니다. 이것은 내가 지금까지 가지고있는 코드가
Array (
[url] => https://www.pinterest.com/login/
[content_type] => text/html; charset=utf-8
[http_code] => 302
[header_size] => 447
[request_size] => 538
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.050214
[namelookup_time] => 3.4E-5
[connect_time] => 3.9E-5
[pretransfer_time] => 9.3E-5
[size_upload] => 43
[size_download] => 0
[speed_download] => 0
[speed_upload] => 856
[download_content_length] => 0
[upload_content_length] => 43
[starttransfer_time] => 0.050187
[redirect_time] => 0
[certinfo] => Array ()
[redirect_url] => http://www.pinterest.com/csrf_error/
) ..
$login_email = 'email';
$login_pass = 'password';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://www.pinterest.com/login/');
curl_setopt($ch, CURLOPT_POSTFIELDS,'email='.urlencode($login_email).'&pass='.urlencode($login_pass));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookies.txt");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
curl_setopt($ch, CURLOPT_REFERER, "https://www.pinterest.com/");
$page = curl_exec($ch);
[email protected]_exec($ch);
$info = @curl_getinfo($ch);
echo $output;
print_r($info);
중복 가능성 (http://stackoverflow.com/questions/10091423/curl-doesnt-recognize-expires-value-in-cookie-correctly) – JakeGould
[컬이 인식하지 못하는 쿠키 올바르게 값 만료] 'CURLOPT_SSL_VERIFYPEER' 및/또는'CURLOPT_CAINFO'를 설정하려고 시도 했습니까? – kero
cURL이 쿠키를 보존 할 수 있다고 생각하지 않습니다. – OPatel