Protossan
@Protossan
студент

Поможете настроить Curl парсинг?

Надо стягивать данные о сайтах. Все бы ничего, нашел хороший сервис, который поддерживает все зоны, делаю парсинг

$agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)';

$url = "http://whois.domaintools.com/toster.ru";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 1);
$headers = array(
	'Content-type: application/xml'
);

curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookies.txt");
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($curl, CURLOPT_REFERER, "http://whois.domaintools.com");
curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
curl_exec($ch);

curl_close($ch);

echo $result;

preg_match("/Created on (.*) Expires on/", $result, $matches);

echo $matches[1];


И после первого раза получаю ответ
DomainTools Lookup Limit

Thank you for using DomainTools for your domain research. You have reached the maximum number of lookups allowable as a free or guest user.

We invest a lot to bring our users the best research tools and the most accurate data. To increase your limit on the number of queries per day and to gain access to a broader set of tools, sign up at our Personal membership level.


При этом из браузера можно смотреть сколько угодно. Подозреваю что дело в заголовках. Можно как-то полностью имитировать браузер юзера?
  • Вопрос задан
  • 262 просмотра
Решения вопроса 2
alsopub
@alsopub
Может быть вам воспользоваться готовым решением - https://github.com/regru/php-whois ?
Ответ написан
politon
@politon
HTML5,CSS3,JS,PHP,SQL,API,canvas,animation...
curl_setopt($curl, CURLOPT_REFERER, "http://google.com");

И profit ;)
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

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

Войти через центр авторизации
Похожие вопросы
Искра Екатеринбург
от 80 000 до 100 000 ₽
Art gorka Санкт-Петербург
от 60 000 ₽
от 40 000 до 60 000 ₽