Created
May 4, 2020 08:52
-
-
Save arxcruz/26c67c0cb6be62d034f78156bcf89ae3 to your computer and use it in GitHub Desktop.
Scrapping
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
from bs4 import BeautifulSoup | |
import requests | |
html_content = requests.get('https://www.who.int/news-room/q-a-detail/q-a-coronaviruses') | |
soup = BeautifulSoup(html_content.text, 'html.parser') | |
q_and_a = soup.find_all('div', class_='sf-accordion__panel') | |
for item in q_and_a: | |
question = item.find('a').text.strip() | |
answer = item.find('p').text.strip() | |
print('{},{}\n'.format(question, answer)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment