Skip to content

Instantly share code, notes, and snippets.

@phoenixatom
Last active May 31, 2020 22:18
Show Gist options
  • Save phoenixatom/de2a51b3b4c6aed4fd351774147ae43a to your computer and use it in GitHub Desktop.
Save phoenixatom/de2a51b3b4c6aed4fd351774147ae43a to your computer and use it in GitHub Desktop.
- An example of scraping using BeautifulSoup in Python
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