BlastingStone

CoVID-19 Live Count

Mar 30th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. import requests
  2. import os
  3. from bs4 import BeautifulSoup as bs
  4. import time
  5.  
  6. coronavirus = "https://www.worldometers.info/coronavirus/"
  7.  
  8. while True:
  9.  
  10. r = requests.get(coronavirus)
  11. soup = bs(r.content, 'lxml')
  12. coronacount = soup.select_one('title').text
  13.  
  14. cases = coronacount[27:34]
  15. deaths = coronacount[45:52]
  16.  
  17. os.system("cls")
  18.  
  19. print("Cases:",cases)
  20. print("Deaths:",deaths)
  21.  
  22. time.sleep(3)
Add Comment
Please, Sign In to add comment