Question

I have this issue where I'm going to need to change my IP every 200 cURL requests - so obviously proxies come to mind. The issue is I'm wondering how I where I would find these proxies. Any solutions? Thanks!

UPDATE: Okay, so for future visitors of this site, if you'd like to use cURL through a random proxy, here's how you'd do it: 1) You'd have to scrape a random proxy off of a proxy site (take this one for example: http://www.hidemyass.com/proxy-list/10) ...save proxy to variable 2) you'd then connect to the site with the proxy using this code:

$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;
Was it helpful?

Solution

Okay, so for future visitors of this site, if you'd like to use cURL through a random proxy, here's how you'd do it: 1) You'd have to scrape a random proxy off of a proxy site (take this one for example: http://www.hidemyass.com/proxy-list/10) ...save proxy to variable 2) you'd then connect to the site with the proxy using this code:

$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;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top