Search engine spider visit websites are carried out by remotely capturing pages. we cannot use JS code to obtain the spider Agent information, but we can use the image tag, in this way, we can obtain the agent material of the spider.
Search engine spider visit websites are carried out by remotely capturing pages. we cannot use JS code to obtain the spider Agent information, but we can use the image tag, in this way, we can obtain the agent material of the Spider. by analyzing the agent material, 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 (250) not null default '',
Unique key 'botid' ('botid '),
KEY 'botname' ('botname ')
) TYPE = MyISAM AUTO_INCREMENT = 9;
#
# Export the table data 'Naps _ stats_bot'
#
Insert into 'Naps _ stats_bot 'VALUES (1, 'googlebot', 'googlebot/2.X (http://www.googlebot.com/bot.html) ', 'googlebot', 0, '2017-00-00 00:00:00 ', '');
Insert into 'Naps _ stats_bot 'VALUES (2, 'msnbot', 'msnbot/0.1 (http://search.msn.com/msnbot.htm) ', 'msnbot', 0, '2017-00-00 00:00:00 ', '');
Insert into 'Naps _ stats_bot 'VALUES (3, 'inktomi slurp', 'slurp/123456', 'slurp', 0, '2017-00-00 00:00:00 ', '');
Insert into 'Naps _ stats_bot 'VALUES (4, 'baidider Ider', 'baidider Ider (http://www.baidu.com/search/spider.htm) ', 'baidider Ider', 0, '2017-00-00 00:00:00 ', '');
Insert into 'Naps _ stats_bot 'VALUES (5, 'yahoobot', 'mozilla/5.0 (compatible; Yahoo! Slurp; http://help.yahoo.com/help/us/ysearch/slurp) ', 'slurp', 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, '2017-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:
/*************************************** ************************************
* NAPS -- Network Article Publish System
*----------------------------------------------
* Bot. php
*-------------------
* Begin: 2004-08-15
* Copyright: (C) 2004 week9
* Email: wapshow@gmail.com
* Homepage: http://www.week9.com