You are on page 1of 2

Assignment - Web Scraping Using Python

Use the Worldometer website link and solve the following question.

1. Scrape the Worldometer website using the BeautifulSoup and


Requests library.
URL:-https://www.worldometers.info/geography/how-many-countries-a
re-there-in-the-world/
2. Collect the data of Country wise Population, World_Share(%)
and 'Land_Area_Km².
3. Analyze the data by using matplotlib and seaborn library.
a. Make a Scatter plot by using Seaborn and Matplotlib of
'Population(2020) vs Land_Area_Km²' and apply the
following customization.
● Make the Figure size (8,6)
● Make a scatter plot such as
x='Population(2020)',y='Land_Area_Km²',palette='Set'
● Add a title to the Plot with fontsize = 15 and color =
purple as 'Population(2020) vs Land_Area_Km²'
● Add Grid to the plot using grid() function
● Also Show the plot using matplotlib show() function

b. Create a Line plot of 'Country vs Land_Area_Km² for top 5


countries by population' and apply the Following
customization to the plot.
● Make the Figure size (15,8)
● Make line/markers color 'indigo'
● Make line width as 2 and line style as '-.'
● Add label as Land_Area_Km²
● Add markers as 'o' with markersize = 10
● Add a title to the Plot with fontsize = 15 and color =
purple
● Add X-Label as Country & Y-Label as Land_Area_Km²
● Add Grid to the plot using grid() function
● Show the legend for the plot using legend() funct

1
● Also Show the plot

c. Create a Line plot of 'Country wise Population(2020)' of


top 5 countries based on population and apply the
Following customization to the plot.
● MMake a plot by setting figure size (10,6) using
seaborn set() function.
● Set the color palette for the plot using the
set_palette() function as "tab10".
● Set the style for the plot using the set_style()
function as "darkgrid".
● Set the context for the plot using set_cotext()
function with following customization ("paper",
font_scale = 2, rc={"grid.linewidth": 0.5}).
● Make a Bar plot using seaborn barplot() function
setting x='Country',y='Population(2020)'.
● Add the title to the plot as 'Country wise
Population(2020)'.
● Add X-label as 'Country' and Y-label as 'Country wise
Population(2020)'
● Make the Xticks rotate 45 degrees.
● Show the plot using show() function of matplotlib

This is a Take Home Assignment. Hence, Please solve the


assignment for your practice and Knowledge Building ,
Assignment Solutions will be Released as usual to enhance
your learning.

You might also like