I'm trying to retrieve meta tags of an external website.
In the view source, I can't see these tags and the only way to get them is by inspecting the elements. However, if I debug the url with facebook debugger, all meta tags are there just fine.
I'm struggled into finding a way to get those tags as a php variables.
The URL: https://play.anghami.com/song/45345900 How FB Scraper sees it: https://developers.facebook.com/tools/debug/echo/?q=https%3A%2F%2Fplay.anghami.com%2Fsong%2F45345900
You can try this code, this code pulls entire webpage, but you can optimize it the way you like.
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER,array('Content-Type: text/plain'));
curl_setopt($ch, CURLOPT_URL, 'https://play.anghami.com/song/45345900');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
header('Content-Type: text/plain');
echo $output;
exit;