我有这个问题,我需要每 200 个 cURL 请求更改我的 IP - 所以很明显代理会浮现在脑海中。问题是我想知道如何在哪里找到这些代理。有什么解决办法吗?谢谢!
更新:好的,因此对于本网站的未来访问者,如果您想通过随机代理使用 cURL,您可以这样做:1)您必须从代理网站上刮取随机代理(以这个为例:http://www.hidemyass.com/proxy-list/10 ) ...将代理保存到变量 2) 然后您将使用以下代码通过代理连接到站点:
$url = 'URL Here';
$proxy = 'SCRAPED PROXY HERE';
//$proxyauth = 'user:password';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_PROXY, $proxy);
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyauth);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
$curl_scraped_page = curl_exec($ch);
curl_close($ch);
echo $curl_scraped_page;