Из-за чего может при парсинге закрытой страницы появлятся 403 ошибка?
header('Content-type: text/html; charset=utf-8');
function get_content($url, $data=[])
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-Requested-With: XMLHttpRequest',
'Accept: application/xml, text/xml, */*; q=0.01',
'Faces-Request: partial/ajax',
'Accept-Language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
'Host: site.ru',
'Origin: https://www.flightclub.com',
'Content-Type: application/x-www-form-urlencoded; charset=UTF-8'
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_COOKIEJAR, __DIR__ .'/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, __DIR__ .'/cookie.txt');
$res = curl_exec($ch);
curl_close($ch);
return $res;
}
$url_auth = "https://www.flightclub.com/customer/account/login?redirectTo=MyAccount";
$url = "https://www.flightclub.com/my-account";
$auth_data = [
'email' => "email',
'password' => 'password',
];
$data = get_content($url_auth, $auth_data);
var_dump($data);
$data = get_content($url);
var_dump($data);