Last active
May 31, 2020 22:18
-
-
Save phoenixatom/de2a51b3b4c6aed4fd351774147ae43a to your computer and use it in GitHub Desktop.
- An example of scraping using BeautifulSoup in Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
res = requests.get("https://mihaaru.com/").text | |
soup = BeautifulSoup(res, 'lxml') | |
details = soup.find_all('div', class_="coronavirus-special-coverage-item")[1].find_all('li') | |
for detail in details: | |
name = detail.find('span', class_='clabel').text | |
number = detail.find('span', class_='number').text | |
print(name, number) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment