This is a Python web scraping project that extracts country information from the website:
https://www.scrapethissite.com/pages/simple/
The script collects country details such as capital city, population, and area, and stores the data into a CSV file.
- Extracts country names
- Extracts capital cities
- Extracts population data
- Extracts area size (km²)
- Saves all data into CSV format
- Uses Requests and BeautifulSoup
- Python
- Requests
- BeautifulSoup
- CSV Module
The script generates a CSV file:
country_data.csv
Example Output:
Country | Capital | Population | Area(km²)
India | New Delhi | 1,380,004,385 | 3,287,263
Install required libraries:
pip install requests beautifulsoup4
Run the script:
python country_scraper.py
This project was created as part of learning Python web scraping and practicing structured data extraction from websites.