Skip to content

danisaleem/Web-Scraping-BeautifulSoup-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Web-Scraping-BeautifulSoup-Python

Learning Web Scraping using BeautifulSoup Python.

What is BeautifulSoup?

BeautifulSoup is a third party Python library from Crummy. The library is designed for quick turnaround projects like screen-scraping

What can it do?

  • Beautiful Soup parses anything you give it and does the tree traversal stuff for you.
  • You can use it to find all the links of a website
  • Find all the links whose urls match "foo.com"
  • Find the table heading that’s got bold text, then give me that text.
  • Find every "a" element that has an href attribute etc.

Libraries used

Beautifulsoup, Pandas and Matplotlib

TASKS

(1) - Data Collection

  1. Collect the name of all the countries per continent from English Wikipedia.
  2. Create countries-continents dataframe, this dataframe should have two columns: country , continent.
  3. Collect the happiness score, GDP per capital, social support, healthy life expectancy, freedom to make life choices, generosity, and perceptions of corruption per country in 2019 from English Wikipedia and put all collected information in a dataframe .
  4. Create a new dataframe with all the information that you collectedand save it in a CSV file.

(2) - Data Visualization

  1. Plot the distribution of happiness score per country.
  2. Find the top 10 happiest countries.
  3. What is the average of happiness.
  4. What are the countries below the median.
  5. Plot the correlation between different variables and give an interpretation. for each continent, give the happiest country.

Links scraped

https://en.wikipedia.org/wiki/World_Happiness_Report#2019_report https://simple.wikipedia.org/wiki/List_of_countries_by_continents

BeautifulSoup Documentation

https://www.crummy.com/software/BeautifulSoup/bs4/doc/

Releases

No releases published

Packages

No packages published