Skip to content

Latest commit

 

History

History
59 lines (34 loc) · 995 Bytes

File metadata and controls

59 lines (34 loc) · 995 Bytes

Country Data Scraper

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.


Features

  • Extracts country names
  • Extracts capital cities
  • Extracts population data
  • Extracts area size (km²)
  • Saves all data into CSV format
  • Uses Requests and BeautifulSoup

Tools Used

  • Python
  • Requests
  • BeautifulSoup
  • CSV Module

Output

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


How to Run

Install required libraries:

pip install requests beautifulsoup4

Run the script:

python country_scraper.py


Project Purpose

This project was created as part of learning Python web scraping and practicing structured data extraction from websites.