W
W
WebEditor2014-07-10 17:02:56
PHP
WebEditor, 2014-07-10 17:02:56

How to get content from Yandex without Yandex.XML?

Good afternoon.
We made a script and stumbled upon a problem with Yandex:

Нам очень жаль, но запросы, поступившие с вашего IP-адреса, похожи на автоматические. По этой причине мы вынуждены временно заблокировать доступ к поиску.

Чтобы продолжить поиск, пожалуйста, введите символы с картинки в поле ввода и нажмите «Отправить».

In general, Yandex returned a page with captcha instead of content.
Used code:
echo file_get_contents("http://yandex.ru/yandsearch?text=мазда");

or
$url = "http://yandex.ru/yandsearch?text=мазда";
$ch = curl_init();
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20);
        curl_setopt($ch, CURLOPT_ENCODING,'gzip,deflate');
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru; ru:1");
        $data = curl_exec($ch);
        curl_close($ch);
        echo $data;

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
darkrain, 2014-07-10
@darkrain

No way. Only if you use a bunch of proxies

L
Lomoson, 2014-07-10
@Lomoson

Even if you use a bunch of proxies, Yandex gradually starts to ban them.
Hang out on SEO forums and buy/ask for additional webmaster units for Yandex.XML.

P
Puma Thailand, 2014-07-10
@opium

solve captcha through anti-gate
use many proxies and VPNs

A
Anton B, 2014-07-10
@bigton

Recognition of one captcha by a remote service can take 30-60 seconds. When Yandex realizes that you are definitely a robot, it will issue a captcha for each request.
Work via XML, limits can be purchased here xmlstock.com/.
All the same, if you make money on promotion, you may incur small costs for withdrawing positions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question