Question: This web page(https://justinjia.people.ust.hk/countries.html) lists information about 249 countries in the world. Write Python code to extract the information on name, capital, population, and area of

This web page(https://justinjia.people.ust.hk/countries.html) lists information about 249 countries in the world. Write Python code to extract the information on name, capital, population, and area of each country. Organize the extracted data into a pandas DataFrame.

# starter code

import requests from bs4 import BeautifulSoup import pandas as pd

response = requests.get("https://justinjia.people.ust.hk/countries.html", timeout=3) soup = BeautifulSoup(response.content, 'html.parser')

# provide your code below

Please visit the web page first and double check the results. The webpage does not have 'tr' or 'td' tag, so the code will have to scrape each information individually.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!