Python 3 Covid19 Vaccine Tracker Web Scraping Script Using BeautifulSoup4 Full Project For Beginners

Python 3 Covid19 Vaccine Tracker Web Scraping Script Using BeautifulSoup4 Full Project For Beginners

 

Welcome folks today in this blog post we will be building a covid19 vaccine tracker in python using beautifulsoup4 library. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to install the following library using the pip command as shown below

 

pip install bs4

 

pip install requests

 

After installing this library make an app.py file and copy paste the following code

 

app.py

 

import requests 
from bs4 import BeautifulSoup 


def getdata(url): 
    r = requests.get(url) 
    return r.text 

htmldata = getdata("https://covid-19tracker.milkeninstitute.org/") 
soup = BeautifulSoup(htmldata, 'html.parser') 
result = str(soup.find_all("div", class_="is_h5-2 is_developer w-richtext")) 

print("NO 1 " + result[46:86]) 
print("NO 2 "+result[139:226]) 
print("NO 3 "+result[279:305]) 
print("NO 4 "+result[358:375]) 
print("NO 5 "+result[428:509])

 

Now if you execute the above script by typing the below command as shown below

See also  Python 3 BeautifulSoup4 Script to Extract All H1,H2 & H3 Tags in Given HTML5 Webpage Full Project For Beginners

 

python app.py

 

Leave a Reply