Forum Moderators: coopster
i've been using php and cURL to pull data from a site, and things worked just fine. however, when i used the same script to access a different site, not data is being returned. however, i can go to the url of the site being used and there is clearly html there which should theoretically be scraped. any idea why it is not being gathered and how can i fix this?
thanks a million!
thanks for the feedback. i'm not getting any error messages which is the strange part, just empty results. i'm actually not too sure about the regex stuff, so i'll post my code (this is just an example of a page thats not working) here and maybe you can give me some suggestions. thanks again!
$ch = curl_init();
$timeout = 0;
curl_setopt ($ch, CURLOPT_URL, "http://www.facebook.com/ajax/networks_ajax.php?city=14330");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
echo $file_contents;
oh also, i don't think my server is configured to use file() :-/