In this article we will see how to make a script to get the details of corona virus cases i.e total cases, recovered cases and total deaths only by typing the name of the country.
Modules required and Installation:
Requests : Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs.
pip install requests
Beautiful Soup: Beautiful Soup is a library that makes it easy to scrape information from web pages. It sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and modifying the parse tree.
pip install beautifulsoup4
In order to make this script we have to do the following :
1. From the name of the country create URL
2. Scrape the data with the help of requests and Beautiful Soup
3. Convert that data into html code.
4. Find the required details and filter them.
5. Save the result in the dictionary.
Below is the implementation –
Cases in United States Total Cases : 654,343 Recovered Cases : 56,618 Total Deaths : 33,490 ---------------------------- Cases in India Total Cases : 12,759 Recovered Cases : 1,514 Total Deaths : 423
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Plotting the Growth Curve of Coronavirus in various Countries using Python
- Corona Virus cases of various countries - Using Python PyQt
- Get Corona cases details - Python PyQt5
- Python IMDbPY – Getting the countries of the series
- Python IMDbPY – Getting Series Countries as XML
- Web Scraping Coronavirus Data into MS Excel
- Getting Instagram profile details using Python
- Python IMDbPY - Retrieving actor from the movie details
- Python IMDbPY - Retrieving role played by actor from the movie details
- Python IMDbPY – Getting series details fro the series id
- Corona Virus Details in India - Using Python PyQt5
- Decorator to print Function call details in Python
- Fetching recently sent mails details sent via a Gmail account using Python
- Application to get address details from zip code Using Python
- Get Bank details from IFSC Code Using Python
- Python | Convert string list into multiple cases
- Useful cases to illustrate Decorators in python
- Python | Alternate cases in String
- Python - Get Confirmed, Recovered, Deaths cases of Corona around the globe
- Difference between various Implementations of Python