This course is general information for learning, not legal advice. For business use of collected data, ask a lawyer.
By the end of this lesson your AI agent will have written a small, polite scraper that collects 60 books from a practice site into a CSV, and you will know how to check its code and what to do when a site says no.
You need: a coding agent, Python 3 and a terminal (see Open a terminal if that's new) · Time: 9 minutes
We practise on books.toscrape.com, a made-up bookstore built for people learning to scrape. Its makers describe it as a safe place for beginners, so you can't upset a real shop while you learn.
Your agent will write the code in Python with two add-on packages:
- requests downloads a web page, like a browser without the screen.
- Beautiful Soup (package name
beautifulsoup4) finds things inside a page's HTML, like "every book title".
Check Python and install both. On Mac or Linux:
Terminal · macOS / Linuxpython3 --version python3 -m pip install requests beautifulsoup4On Windows:
PowerShell · Windowspy --version py -m pip install requests beautifulsoup4Why?Practising on a site built for scraping means your mistakes (too fast, wrong pages, a loop) cost nobody anything. You learn the habits first, on a safe target.
Log in free to read the rest of this lesson
Every lesson is free. A free account unlocks all of them and saves your progress.
Still to come in this lesson:
- The six rules of a polite scraper
- The Prompt Card for your scraper
- Read the code before you run it
- Run it and check the result
- When the site says no
- Recap