The search engine crawlers access websites by capturing pages remotely. we cannot use JS code to obtain the Agent information of the spider, but we can use the image tag, in this way, we can obtain the agent information of the spider... the search engine crawlers access websites by capturing pages remotely. we cannot use JS code to obtain the Agent information of the spider, but we can use the image tag, in this way, we can obtain the agent data of the Spider. by analyzing the agent data, we can determine the types, gender, and other factors of the spider, we can record statistics through databases or text.
Database structure:
# TABLE structure 'Naps _ stats_bot '# create table 'Naps _ stats_bot' ('botid' int (10) unsigned not null auto_increment, 'botname' varchar (100) not null default '', 'botagent' varchar (200) not null default'', 'bottag' varchar (100) not null default '', 'botcount' int (11) not null default '0', 'botlast 'datetime not null default '2017-00-00 00:00:00 ', 'botlasturl' varchar (0000) not null default '', unique key 'botid' ('botid'), KEY 'botname' ('botname') TYPE = MyISAM AUTO_INCREMENT = 9; # export data in the table 'Naps _ stats_bot '# insert into 'Naps _ stats_bot' VALUES (1, 'googlebot ', 'googlebot/2.X ( http://www.googlebot.com/bot.html ) ', 'Googlebot', 0, '2014-00-00 00:00:00 ', ''); insert into 'Naps _ stats_bot' VALUES (2, 'msnbot ', 'msnbot/0.1 ( http://search.msn.com/msnbot.htm ) ', 'Msnbot', 0, '2014-00-00 00:00:00 ', ''); insert into 'Naps _ stats_bot' VALUES (3, 'inktomi slurp ', 'slurp/100', 'slup', 0, '2017-00-00 00:00:00 ', ''); insert into 'Naps _ stats_bot' VALUES (4, 'baidider Ider ', 'baiduspider ( http://www.baidu.com/search/spider.htm ) ', 'Baidider', 0, '2014-00-00 00:00:00 ', ''); insert into 'Naps _ stats_bot' VALUES (5, 'yahoobot ', 'The Mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp ) ', 'Slup', 0, '2017-00-00 00:00:00', ''); insert into 'Naps _ stats_bot 'VALUES (6, 'sohubot ', 'sohu-search', 'sohu-search', 0, '2017-00-00 00:00:00 ', ''); insert into 'Naps _ stats_bot' VALUES (7, 'lycos ', 'lycos/x. x', 'lycos ', 0, '2014-00-00 00:00:00', ''); insert into 'Naps _ stats_bot 'VALUES (8, 'robozilla ', 'robozilla/123456', 'robozilla ', 0, '2017-00-00 00:00:00 ','');
PHP program:
Query ("UPDATE naps_stats_bot SET botcount = botcount 1, botlast = NOW (), botlasturl = '$ tlc_thispage' WHERE botname = '$ searchbot'") ;}?>
Address:
Reprinted at will, but please attach the article address :-)