Как отправить ответ на капчу Яндекса?

cURLом на PHP парсю Яндекс. Через некоторое время парсится капча. Как отправить на нее ответ?

Пробовал так:

function file_get_contents_alt($url) {

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER["HTTP_USER_AGENT"]);
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 200);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie_yandex.txt');
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie_yandex.txt');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

$data = curl_exec($ch);
curl_close($ch);

return $data;

}


$output = file_get_contents_alt('http://yandex.ru/checkcaptcha?key='.urlencode($_POST['capcha_key']).'&rep='.$_POST['yandex_iks_cap'].'&retpath='.urlencode(html_entity_decode($_POST['capcha_retpath'])));


Но ответ - HTTP/1.1 400 Bad request
  • Вопрос задан
  • 125 просмотров
Пригласить эксперта
Ответы на вопрос 2
@Georg
Ответ не в тему, но для парсинга правильнее использовать Яндекс.XML
Ответ написан
dimonchik2013
@dimonchik2013
non progredi est regredi
чекай fiddler ом чтобы 1 в 1 совпадали заголовки
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы