douan7601 2013-05-14 06:07
浏览 14
已采纳

以编程方式通过URL识别CMS [关闭]

Is there any other way to detect CMS from URL? If yes, is there any available API in PHP o any other language? The site http://whatcms.org/ is an example of what i have in mind; how does it do the detection?

  • 写回答

4条回答 默认 最新

  • dongziche8030 2013-05-14 06:12
    关注

    You could check the meta tag for generator. Most CMS have their name and version advertised there.

    This is the tag you're after.

    <meta name="generator" content="Joomla! - Open Source Content Management" />
    

    This code will try and find the tag to extract the content attribute.

    $doc = new DOMDocument();
    $doc->loadHTMLFile('http://joomla.org');
    $xpath = new DOMXPath($doc);
    
    $generators = $xpath->query('//html/head/meta[@name="generator"]');
    
    echo $generators->item(0)->getAttribute('content');
    

    This code echo's Joomla! - Open Source Content Management

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 SQL Server下载
  • ¥15 python如何将动态的多个子列表,拼接后进行集合的交集
  • ¥20 vitis-ai量化基于pytorch框架下的yolov5模型
  • ¥15 如何实现H5在QQ平台上的二次分享卡片效果?
  • ¥15 python爬取bilibili校园招聘网站
  • ¥30 求解达问题(有红包)
  • ¥15 请解包一个pak文件
  • ¥15 不同系统编译兼容问题
  • ¥100 三相直流充电模块对数字电源芯片在物理上它必须具备哪些功能和性能?
  • ¥30 数字电源对DSP芯片的具体要求