May somebody help my how should I parse this link by curl?
https://www.linkedin.com/in/williamhgates/
And this is my codes:
Just run it and look at the result:
$url = "https://www.linkedin.com/in/williamhgates/";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.linkedin.com/in/williamhgates/'));
$output = curl_exec($ch);
curl_close($ch);dd($output);die;
I just want to get whole of the source in a file but it shows:
Could not process this client request HTTP method request for URL
Linked in does not allow all crawlers except a few which send them traffic (Google bot, Bingbot, etc), They have explicitly blocked the User-agent. So it is not possible to make curl request to Linkedin page. But still anyhow you manage to crawl Linkedin, it could create legal issues for you. Hence, it’s better to leave Linkedin alone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With