I want to parse the site using a curl and a proxy. Here is the code:

function curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, " Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0 .2564.109 Safari/537.36"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0); curl_setopt($ch, CURLOPT_PROXY, '94.181.34.64:8080'); curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); $output = curl_exec($ch); curl_close($ch); return $output; } $auth = curl($link); $parser = phpQuery::newDocument($auth); echo $parser; 

But as a result, an empty screen. Tell me where the error is. Kurl always used, but with a proxy and such problems encountered for the first time. 2) If everything is done without a proxy, the site skips 1-2 times, then blocks ip. And even in the positive case, a redirect will automatically redirect to the site itself, that is, there is no content upload. How can I fix this? thank

    0