我们可以通过读取HTTP_USER_AGENT来判断请求,从而做到屏蔽页面抓取。

国内一些蜘蛛的UA:

$spiders = array(
‘Googlebot’,
‘Baiduspider’,
“Sogou web spider”,
“360Spider”,
“YisouSpider”,
“Sosospider”,
“YoudaoBot”,
‘Yahoo! Slurp’,
‘EasouSpider’,
‘bingbot’
);

模板兔给出大致的代码供参考:

$ua = $_SERVER['HTTP_USER_AGENT'];    //将恶意USER_AGENT存入数组    $now_ua = array('FeedDemon ','BOT/0.1 (BOT for JCE)','CrawlDaddy ','Java','Feedly','UniversalFeedParser','ApacheBench','Swiftbot','ZmEu','Indy Library','oBot','jaunty','YandexBot','AhrefsBot','MJ12bot','WinHttp','EasouSpider','HttpClient','Microsoft URL Control','YYSpider','jaunty','Python-urllib','lightDeckReports Bot');    //禁止空USER_AGENT,dedecms等主流采集程序都是空USER_AGENT,部分sql注入工具也是空USER_AGENT    if(!$ua) {  header("Content-type: text/html; charset=utf-8");    die('禁止爬取');    }else{  foreach($now_ua as $value ){    //判断是否是数组中存在的UA    if(strpos($ua,$value) !== false){  header("Content-type: text/html; charset=utf-8");    die('禁止爬取');    }  }    }

新软师兄 » WordPress网站如何防止爬虫恶意抓取或采集
50T免费网盘资源大集合【持续更中~~~~】:点击查看

dase kand pornhan.mobi xvideo desi gay pcso 2pm result today pinoytvfriends.com where i can watch bad romeo كلام فى النيك wfporn.com قصص محارم حديثة busporn porngugu.mobi indian sexx vedios sex ka video noticieroporno.com himachal pradesh sex com
nero hentai hentaitgp.com ламия хентай www.mom xxx.com alohaporn.me sahara knite mature fucking tubepatrolporn.com bhabi sex indian girl sex gotporn.mobi xnxx family strocks ang probinsyano july 20 2022 full episode youtube pilipinoteleserye.com ano ang pambansang sasakyan ng pilipinas
احلي سكس محارم pornxporn.org نيك فلاحى multi.xnxx alohaporn.net telugu sex chart سكس قصيرات arabysexy.org نيك نقاب www assames sex com umora.info desi sexy bhabi 8teenx bukaporn.com india hot sex videos