当前位置: 动力学知识库 > 问答 > 编程问答 >

php - How it is possible to detect curl?

问题描述:

Google search detects my curl request. But how google does that? When I send request from my browser with proxy there is no captcha. Then I send the same request from curl and captcha appears. I think if I send the same request I will receive the same response. Or not?

$url = 'http://www.google.com/search?q=curl';

$host = parse_url($url);

$host = $host['host'];

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_HTTPHEADER, [

"Host: $host",

"User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0",

"Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",

"Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3",

"Accept-Encoding: gzip, deflate, br",

"Connection: keep-alive",

"Pragma: no-cache",

"Cache-Control: no-cache",

"Expect:"]);

curl_setopt($ch, CURLOPT_PROXY, 'http://85.195.93.187:42084');

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);

curl_setopt($ch, CURLOPT_HEADER, true);

curl_setopt($ch, CURLOPT_SSLVERSION, 3);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);

curl_setopt($ch, CURLOPT_VERBOSE, true);

curl_exec($ch);

Notice when I send request without proxy it works.

分享给朋友:
您可能感兴趣的文章:
随机阅读: