473,396 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How can I tell if a visitor is a search engine bot?

Hi, I am writing some code to log vistors to my website.

I notice in some statistics pacakages that they are able to differentiate
between normal visitors and search bots. Does anyone know how that is done?

I thought that they might be looking at the IP address of the remote visitor
and then if the IP range is associated with Google or whatever than that
"person" is a bot...

Any ideas welcome
thanks
Mark
Nov 19 '05 #1
4 1550
You'll want to look at the Agent header coming in with the request.

Here are some reference sources:
http://www.google.com/search?hl=en&q...+agent+strings

HTH!

--
Scott
http://www.OdeToCode.com/blogs/scott/
Hi, I am writing some code to log vistors to my website.

I notice in some statistics pacakages that they are able to
differentiate between normal visitors and search bots. Does anyone
know how that is done?

I thought that they might be looking at the IP address of the remote
visitor and then if the IP range is associated with Google or whatever
than that "person" is a bot...

Any ideas welcome
thanks
Mark

Nov 19 '05 #2
You can check the Request.UserAgent property. Each major search bot
uses a different user agent, so you'd need to check against a list. The
biggest ones are googlebot, msnbot, and slurp (Yahoo).

Here's a partial list:
http://webmaster-resources.web-maste...ification.html

If you just want to prevent search engines from spidering all or
portions of your site, you can do this with a robots.txt file at the
root of your site:
http://www.searchengineworld.com/rob...s_tutorial.htm

Keep in mind that it is possible for users can change their user agent
(for instance via the Firefox User Agent Switcher extension), so if you
have pages of your site that you want to allow only subscribers or
search engines, you'd need to check against an IP whitelist to keep
people out.

- Jon
http://weblogs.asp.net/jgalloway

Nov 19 '05 #3
Hi, thanks for your help
Regards
Mark

"Mark" <ma**@Z-Zvolution.nZt> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...
Hi, I am writing some code to log vistors to my website.

I notice in some statistics pacakages that they are able to differentiate
between normal visitors and search bots. Does anyone know how that is done?
I thought that they might be looking at the IP address of the remote visitor and then if the IP range is associated with Google or whatever than that
"person" is a bot...

Any ideas welcome
thanks
Mark

Nov 19 '05 #4
note: following these bot rules is strictly up to the bot. the major engines
are polite and do, but not all.

-- bruce (sqlwork.com)

"jongalloway" <jo*********@gmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
| You can check the Request.UserAgent property. Each major search bot
| uses a different user agent, so you'd need to check against a list. The
| biggest ones are googlebot, msnbot, and slurp (Yahoo).
|
| Here's a partial list:
| http://webmaster-resources.web-maste...ification.html
|
| If you just want to prevent search engines from spidering all or
| portions of your site, you can do this with a robots.txt file at the
| root of your site:
| http://www.searchengineworld.com/rob...s_tutorial.htm
|
| Keep in mind that it is possible for users can change their user agent
| (for instance via the Firefox User Agent Switcher extension), so if you
| have pages of your site that you want to allow only subscribers or
| search engines, you'd need to check against an IP whitelist to keep
| people out.
|
| - Jon
| http://weblogs.asp.net/jgalloway
|
Nov 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Rod | last post by:
Hi, i am doing a ecommerce website and would like to implement a search engine to find products. All the serach engine I have found on the web are parsing html page! This is not what i want. i...
0
by: R. Rajesh Jeba Anbiah | last post by:
Q: Is PHP search engine friendly? Q: Will search engine spiders crawl my PHP pages? A: Spiders should crawl anything provided they're accessible. Since, nowadays most of the websites are been...
11
by: Petre Huile | last post by:
I have designed a site for a client, but they have hired an internet marketing person to incrase their search engine ranking and traffic. He wants to put extra-large fonts on every page which will...
5
by: George | last post by:
Hi, Anyone has the background for explaining? I have made a search on my name and I have got a link to another search engine. The link's title was the search phrase for the other search engine...
14
by: vic | last post by:
My manager wants me to develop a search program, that would work like they have it at edorado.com. She made up her requirements after having compared how search works at different websites, like...
2
by: Patrick | last post by:
Are the differences between a search engine, a subject directory and a meta search engine significant for an ebusiness web site owner? A meta search engine merely uses ordinary existing search...
5
by: Sam | last post by:
Does anyone know of a way to create a search page under ASP.NET 2.0? I have started out by configuring a catalog in Index Server, registering the aspx, ascx extensions in the registry to allow...
2
by: radiox | last post by:
Hi, I build a website who can monitor other website's visitors and build some reports. I use PHP/MySQL and Javascript. I am stucked at the point when I have to get the page where the...
4
by: MDW | last post by:
Posted this on another board, but evidently it was off-topic there...hope you folks will be able to provide some guidance. I've been working on a Web site for a business (my first non-personal...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.