10Flake

Untitled

May 14th, 2021
772
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from bs4 import BeautifulSoup
  2. import requests
  3.  
  4. html_text = requests.get('https://www.worldometers.info/coronavirus/').text
  5. soup = BeautifulSoup(html_text, 'lxml')
  6.  
  7. data = soup.find('div', class_ = 'content-inner')
  8.  
  9. for tag in data.find_all('h1'):
  10.     print(tag.text)
  11.     for mainCounter in data.find_all('div', {"class":"maincounter-number"}):
  12.         print(mainCounter.text)
RAW Paste Data