douhuanchi6586 2019-01-18 13:37
浏览 19

获取外部网站元标记与fb调试器

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

  • 写回答

1条回答 默认 最新

  • doutuan8887 2019-01-18 14:21
    关注

    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;
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看