Answer the question
In order to leave comments, you need to log in
Why don't curl proxies work?
Parsing, I mean the 2gis site, everything was fine and then they tell me your IP is banned, I decided to put a proxy and it also gives me a window that the IP is banned and already with the proxy IP. What's wrong ? Maybe something in the hosting settings?
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$url = "https://2gis.ru/novosibirsk/firm/141265769757489";
$curl = curl_init($url);
$proxy = '153.92.5.186:8080';
//curl_setopt($curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
//curl_setopt($curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5);
curl_setopt($curl, CURLOPT_PROXY, $proxy);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
$page = curl_exec($curl);
echo $page;
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question