Skip to content
C

Save Scraped Data to CSV

Easypython

Given a list of scraped product records, save them to a CSV file using csv.DictWriter, then read them back and print each one.

Approach: build a list of {"title": ..., "price": ...} dictionaries, write them with csv.DictWriter (header + rows), then reopen with csv.DictReader and print each row.

Input: First line: the number of products n. Next n lines: title,price.

Output: One line per product: <title>: <price>.

Input (stdin)

Output

Run your code to see output here...