Trying to parse some phone numbers from a website.
While I’m getting the source code via cURL, I get back only half of the code but the part that’s missing is exactly what I need. This thing keeps bugging me.
My code so far:
$ch = curl_init("http://www.baroul-bucuresti.ro/index.php?w=definitivi&l=C&p=2");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$content = curl_exec($ch);
curl_close($ch);
print_r ($content);
I think the problem is that the url in question has a 302 in it, redirecting it to another location:
I’ve changed your code by adding this option to curl:
And it seems to get the full contents now.. dont know if its the content you want, but it gets the full contents of the real location, could you give it a try?