scrape all the books from this site into excel, title price availability https://books.toscrape.com
Scrape all products from a website into Excel
The agent wrote and ran a scraper itself: 1,000 books from 50 pages, with prices and ratings, in Excel in 2.5 minutes. And it handed over the script to run later on your own.
- The agent worked
- 5 min
- It cost
- $0.09
- Steps
- 9
- Files
- 3
Scrape all products from a website into Excel
Problembot
The task
A website's catalogue has to go into a spreadsheet: each book's title, price and availability. books.toscrape.com has 1,000 books on 50 pages, an evening of copy and paste by hand. The person cannot program.
What the agent was told
One sentence with a link to the site. Then: add the rating as stars, and send the script itself, to run it without the agent.
How the agent solved it
The agent looked into how the site is built: how many pages there are and where the title, price and availability sit. Then it wrote a Python script on its computer, ran it over all 50 pages and checked that there were exactly 1,000 rows. It added the rating in a separate pass and matched every row by title. At the end it made the scraper a file of its own, ran it and made sure it again collected 1,000 books.
The result
books.xlsx: 1,000 books, the price as a number in pounds, a frozen header row and a filter.books_rating.xlsx: the same plus a "Rating" column in stars.scrape_books.py: a ready scraper with instructions on how to run it.
We checked a sample of rows against the site, and everything matched. The script ran on our machine in 13 seconds and produced the same table. The agent worked for about four and a half minutes over three messages, and it all cost $0.09.
What did not work
- The rating is written as star characters, not as a number, so sorting or filtering by it is awkward.
- Availability stayed in English ("In stock").
- The script's instructions assume Python is already installed. The agent did not explain how to install it or where to type the commands.
- Every book on the site is in stock, so the "Availability" column filters nothing out here. The agent said so plainly.