Web Scraping19 min read
Saving Data to CSV
Learn how to store scraped data into CSV files for Excel and analysis.
David Miller
Nov 20, 2025
35.3k1,590
Scraping is useless if you don’t save data.
CSV is simple and universal.
Writing CSV
import csv
rows = [
["Name", "Price"],
["Laptop", "900"],
["Phone", "500"]
]
with open("products.csv", "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerows(rows)
Graph
flowchart LR
A[Scraped Data] --> B[CSV File]
B --> C[Excel / Analysis]
Remember
- CSV works everywhere
- Always add headers
#Python#Intermediate#Storage