Data Formats (CSV, JSON, Excel)
Once you've scraped data, you need to store it. This lesson covers the most common output formats.
Choosing a Format
Loading Python Playground...
Saving to CSV
Loading Python Playground...
Reading CSV
Loading Python Playground...
Saving to JSON
Loading Python Playground...
JSON Lines Format
Loading Python Playground...
Saving to Excel
Loading Python Playground...
Using Pandas for Data Export
Loading Python Playground...
Appending Data
Loading Python Playground...
Handling Special Characters
Loading Python Playground...
Complete Export Example
Loading Python Playground...
Key Takeaways
- CSV is best for simple, tabular data
- JSON handles nested structures well
- JSON Lines is great for streaming/appending data
- Excel is ideal for business stakeholders
- Pandas simplifies all export operations
- Always use UTF-8 encoding for special characters
- Consider JSONL for large-scale scraping
- Match the format to your use case

