Skip to content

This Python Web Scraping project demonstrates how to extract data from websites using libraries like BeautifulSoup and requests. It automates the process of gathering structured information from the web, such as product details, prices, or other publicly available data.

Notifications You must be signed in to change notification settings

Tapas-Gope/Web-Scrapping-with-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Web Scrapping with Python 🌐 🖥️ 🛜

web-scraping-python-img

Description:

This Python script extracts data on Asian countries from the Wikipedia page "List of Asian Countries by Area" (https://en.wikipedia.org/wiki/List_of_Asian_countries_by_area). It utilizes the requests and BeautifulSoup libraries to retrieve and parse the HTML content, then extracts country names and creates a Pandas DataFrame for further analysis.  

Features:

  • Fetches data from the specified Wikipedia page.
  • Extracts country names from the table.
  • Creates a Pandas DataFrame with a column named "Country".

Installation:

This script requires the following Python libraries:

  • requests
  • beautifulsoup4
  • pandas

You can install them using pip:

pip install requests beautifulsoup4 pandas

Usage:

  • Save the code as a Python file (e.g., asian_countries_data.py).
  • Run the script from your terminal.

python asian_countries_data.py

This will print a Pandas DataFrame containing the extracted country names.

Output:

The output will be a Pandas DataFrame with a single column named "Country" containing the list of Asian countries retrieved from the Wikipedia page.

Note:

This script assumes the Wikipedia page structure is consistent. Any changes to the page layout might require adjustments to the code for accurate data extraction.

Additional Notes:

  • You can enhance this script by adding error handling to gracefully handle network issues or unexpected HTML changes.
  • Consider filtering the extracted data based on specific criteria or adding additional columns to the DataFrame based on your needs.
  • Feel free to modify and extend this code to suit your specific data extraction requirements.

About

This Python Web Scraping project demonstrates how to extract data from websites using libraries like BeautifulSoup and requests. It automates the process of gathering structured information from the web, such as product details, prices, or other publicly available data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published