首页 > 技术文章 > php 爬虫探针

a-flydog 2017-02-21 16:06 原文

 

if(preg_match("/(googlebot|baiduspider|sogou|360spider|bingbot)/i"$_SERVER['HTTP_USER_AGENT'])) {
    //是搜索引擎蜘蛛
}else{
    //普通访客
}

推荐阅读