Advertisement
10Flake

Untitled

May 14th, 2021
1,197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  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)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement