import requests
from bs4 import BeautifulSoup


def who_spider():
    """ Scrape faqs from who website """
    WHO_URL = "https://www.who.int/csr/disease/coronavirus_infections/faq_dec12/en/"
    who_faqs_page = requests.get(WHO_URL)

    soup = BeautifulSoup(who_faqs_page.content, "html.parser")

    faqs_container = soup.find(id="primary")
    questions = faqs_container.find_all("h3", class_="section_head1")
    answers = faqs_container.find_all("span")

    # Remove the first span item that contains a date
    answers.pop(0)

    faqs = []

    for (question, answer) in zip(questions, answers):
        faqs.append(
            {"question": question.text, "answer": answer.text,}
        )

    return faqs

import requests
from bs4 import BeautifulSoup


def who_spider():
    """ Scrape faqs from who website """
    WHO_URL = "https://www.who.int/csr/disease/coronavirus_infections/faq_dec12/en/"
    who_faqs_page = requests.get(WHO_URL)

    soup = BeautifulSoup(who_faqs_page.content, "html.parser")

    faqs_container = soup.find(id="primary")
    questions = faqs_container.find_all("h3", class_="section_head1")
    answers = faqs_container.find_all("span")

    # Remove the first span item that contains a date
    answers.pop(0)

    faqs = []

    for (question, answer) in zip(questions, answers):
        faqs.append(
            {"question": question.text, "answer": answer.text,}
        )

    return faqs

Scrape faqs from who website # Remove the first span item that contains a date