Git Product home page Git Product logo

web-scraping-beautifulsoup-python's Introduction

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/

web-scraping-beautifulsoup-python's People

Contributors

danisaleem avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.