Wirebook

Wirebook › Lesson 17 of 18

What are bots doing on the web?

About 7 minutes · hands-on · nothing you type leaves your browser unless a button says so

Right now, millions of little programs are reading the web, page after page, all day and all night. They're called bots (short for robots), and nearly half of all web traffic comes from them. Some are helpers: search-engine crawlers that read pages so you can find them later. Some are pests. Here you get to be a crawler on a tiny pretend web, then play bouncer and spot which visitors are bots.

Be a crawler robot

A pretend web of three made-up websites and ten pages. Your robot starts on one page, reads it, writes down its words and adds every link it finds to a to-do list. Press Step to crawl one page at a time, or Crawl it all. Try it as a polite robot, then switch the rules off and see what happens.

Your robot is on the start line.

The pretend web

    on the to-do list read skipped (sign says no) blocked

    Robot's diary

      What a crawler really does

      1. Start somewhere. A crawler begins with a list of addresses it already knows.
      2. Read the sign on the door. Before anything else, a polite crawler asks for /robots.txt, a little text file where the site says which rooms robots should stay out of. Here's this site's real one: it asks robots not to poke at /api/.
      3. Read the page and write it down. It notes the words, the title and where every link goes. Those notes become the search engine's index.
      4. Follow the links. Every new link goes on the to-do list, and round it goes. That's why a page nobody links to is so hard to find, unless the site lists it in a sitemap.xml.
      5. Don't stampede. A good crawler leaves a gap between visits to the same site, so it never makes the website tired.
      The sign is a request, not a lock. robots.txt only works because good robots choose to obey it. A rude bot can walk straight past. So anything truly private needs a real lock, like a password, not just a "please keep out" sign. Your robot's diary shows exactly that. To try a real robots.txt against any path, use Tooltern's free robots.txt tester (paste the file — it never fetches).

      Bouncer: bot or human?

      You run a little website. Here's what eight visitors did. For each one, decide: was it a person or a bot? Then see what the website would notice. All made up, of course.

      Decide all 8.

        Good bots, pest bots

        Helpers read the web so search engines can answer you, check that websites are still up (like this site's status page), translate pages and archive old ones so history isn't lost. They usually say who they are and obey the sign.

        Pests copy whole websites, grab every concert ticket in a second, try thousands of passwords, or post junk in comment boxes. They hide who they are and go as fast as they can. Websites catch them with the same tricks you just used: things no person would do, like reading 300 pages in two seconds, filling in a box people can't even see (a honeypot trap), or ignoring the sign. Then they slow them down with a rate limit or show a puzzle that's easy for people and hard for bots.

        Careful with "bot or not". Some real people browse in ways that look unusual: with a screen reader that reads pages aloud, with pictures turned off, or using the keyboard instead of a mouse. Good websites make sure their bot checks never lock those people out.

        Words from this lesson

        Earn your stamp

        Get all 3 right to collect the Bots & crawlers stamp. Wrong answers are fine: just try again.

        1. What does a search engine's crawler do?

        2. A website's robots.txt says Disallow: /secret. What does that do?

        3. Which visitor is most likely a bot?

        Try another lesson

        1. 18What is a cookie on a website?7 min · interactive
        2. 1What happens when you open a web page?6 min · interactive
        3. 2Anatomy of a web address5 min · interactive