Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Search Engine Spiders


Published on

Full tutorial on what spiders are, how they work, why we need them and how to create and maintain your own.

Published in: Technology, Design
  • Be the first to comment

Search Engine Spiders

  1. 1. Search Engine Spiders IR tutorial series: Part 2
  2. 2. ...programs which scan the web in a methodical and automated way. ...they copy all the pages they visit and leave them to the search engine for indexing. ...not all spiders have the same job though, some check links, or collect email addresses, or validate code for example. Spiders are... ...some people call them crawlers, bots and even ants or worms. (“Spidering” means to request every page on a site)
  3. 3. A spider's architecture: Downloads web pages Stuff is stored URLs get queued Co-ordinates the processes
  4. 4. An example
  5. 5. The crawl list would look like this (although it would be much much bigger than this small sample): The spider will also save a copy of each page it visits in a database. The search engine will then index those. The first URLs given to the spider as a starting point are called “seeds”. The list gets bigger and bigger and in order to make sure that the search engine index is current, the spider will need to re-visit those links often to track any changes. There are 2 lists: a list of URLs visited and a list of URLs to visit. This list is known as “The crawl frontier”.
  6. 6. Difficulties <ul><li>The web is enormous: no search engine indexes more than 16% of the web. The spider will download only the most relevant pages. </li></ul><ul><li>The rate of change is phenomenal – a spider needs to re-visit pages often to check for updates and changes. </li></ul><ul><li>Server-side scripting languages do not often return unique content but give a lot of URLs for the spider to visit,which is a waste of time for it </li></ul>
  7. 7. Solutions Spiders will use the following policies: <ul><li>A selection policy that states which pages to download.
  8. 8. A re-visit policy that states when to check for changes to the pages.
  9. 9. A politeness policy that states how to avoid overloading websites.
  10. 10. A parallelization policy that states how to coordinate distributed web crawlers. </li></ul>
  11. 11. Build a spider You can use any programming language that you feel comfortable with, although JAVA, Perl and C# ones are the most popular. You can also use these tutorials: Java sun spider - Chilkat in python - Swish-e in Perl - Remember that a poorly designed spider can impact overall network and server performance.
  12. 12. OpenSource spiders You can use one of these for free (some knowledge of programming can help in setting them up): OpenWebSpider in C# - Arachnid in Java - Java-web-spider - MOMSpider in perl -
  13. 13. Robots.txt This is a file that allows webmasters to give instructions to visiting spiders who must respect it. Some areas are off-limits. Disallow spider from everything User-agent: * Disallow: / Disallow all except Googlebot and BackRub, which can access /private User-agent: Googlebot User-agent: BackRub Disallow: /private and churl, which can access everything User-agent: churl Disallow:
  14. 14. Spider ethics There is code for spiders that developers must follow and you can read them here: In (very) short: <ul><li>Are you sure the world needs another spider?
  15. 15. Identify the spider, yourself and publish your documentation.
  16. 16. Test locally
  17. 17. Moderate the speed and frequency of runs to a given host
  18. 18. Only retrieve what you can handle (format & scale)
  19. 19. Monitor your runs
  20. 20. Share your results </li></ul>List your spider in the database
  21. 21. Spider traps Intentionally and non-intentionally, traps crop up on the spider's path sometimes and stop it functioning properly. Dynamic pages, deep directories that never end, pages with special links and commands pointing the spider to other directories...anything that can put the spider into an infinite loop is an issue. You might however want to deploy a spider trap if you know that one is visiting your site and not respecting your robots.txt for example or because it's a spambot.
  22. 22. Fleiner's spider trap <html><head><title> You are a bad netizen if you are a web bot! </title> <body><h1><b> You are a bad netizen if you are a web bot! </h1></b> <!--#config timefmt=&quot;%y%j%H%M%S&quot; --> <!-- of date string --> <!--#exec cmd=&quot;sleep 20&quot; --> <!-- make this page sloooow to load --> To give robots some work here some special links: these are <a href=a<!--#echo var=&quot;DATE_GMT&quot; -->.html> some links </a> to this <a href=b<!--#echo var=&quot;DATE_GMT&quot; -->.html> very page </a> but with <a href=c<!--#echo var=&quot;DATE_GMT&quot; -->.html> different names </a> You can download spider traps and find out more at Fleiner's page:
  23. 23. Web 3.0 crawling <ul><li>Web 3.0 allows machines to store, exchange, and use machine-readable information. </li></ul><ul><li>A website parse template is based on XML and provides HTML structure description of web pages. </li></ul><ul><li>This allows a spider to generate RDF triples for web pages. These have a subject (i,e:dog), a predicate (i.e. blue), and an object (equivalent to the value of the resource property type or the specific subject) – 3 is the magic number! Each RDF triple is a complete and unique fact. </li></ul><ul><li>This way humans and machines can share the same information. </li></ul><ul><li>We call these “scutters” rather than Spiders (or all other variants). They consume and act upon RDF documents, which is why they're different. </li></ul>
  24. 24. Other resources <ul><li>O'Reilley &quot;Spidering hacks&quot;
  25. 25. BotSpot
  26. 26. Web crawling by Castillo
  27. 27. Finding what people want by Pinkerton
  28. 28. Sphinx crawler by Miller and bharat
  29. 29. Help web crawlers crawl your website by IBM
  30. 30. Bean software spider components and info
  31. 31. Ubi crawler
  32. 32. Search engines and web dynamics </li></ul>