Scrape Multi-Page E-commerce Data with BeautifulSoup
Beginner Mode

Start your terminal to use beginner mode.

Scenario

A website has a product listing page with links to individual product detail pages. You need to scrape data from both the list page and detail pages to create a complete dataset.

Task

Write a Python script at /home/interview/scrape_products.py that scrapes the product listing at http://shop.local/products/, follows links to individual product pages, extracts information from both pages, and saves the combined data to /home/interview/products.csv.

Note: The beautifulsoup4 and requests packages are already installed.

Example

Expected output in /home/interview/products.csv:

id,name,price,brand,description,stock_status,rating
1,Wireless Mouse,$29.99,TechBrand,High-precision wireless mouse...,In Stock,4.5
2,Mechanical Keyboard,$89.99,KeyMaster,RGB mechanical keyboard...,In Stock,4.8
...

Terminal requires a larger screen

Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.

Linux Terminal Environment

Write and execute your solution in the terminal below.

Sign In

Track

Question Difficulty Company Access
Need more practice in this area? Explore more questions →