Skip to content

Instantly share code, notes, and snippets.

@KaushikShresth07
Created June 15, 2021 15:05
Show Gist options
  • Select an option

  • Save KaushikShresth07/3fd742a2bea410a6f95b434bc545c8af to your computer and use it in GitHub Desktop.

Select an option

Save KaushikShresth07/3fd742a2bea410a6f95b434bc545c8af to your computer and use it in GitHub Desktop.
def CoronaVirus(Country):
countries = str(Country).replace(" ","")
url = f"https://www.worldometers.info/coronavirus/country/{countries}/"
result = requests.get(url)
soups = bs4.BeautifulSoup(result.text,'lxml')
corona = soups.find_all('div',class_ = 'maincounter-number')
Data = []
for case in corona:
span = case.find('span')
Data.append(span.string)
cases , Death , recovored = Data
Speak(f"Cases : {cases}")
Speak(f"Deaths : {Death}")
Speak(f"Recovered : {recovored}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment