from bs4 import BeautifulSoup


def extract_prereqs(raw_description: BeautifulSoup) -> str:
    """
    Parse prerequisites from description beautifulsoup.

    Parameters
    ----------
    raw_description:
        BeautifulSoup of course description HTML

    Returns
    -------
    prerequisites text
    """
    # course prerequisites
    prereqs = raw_description.findAll("p", {"class": "prerequisites"})
    if len(prereqs) >= 1:
        prereqs = "\n".join([x.get_text() for x in prereqs])

        return prereqs

    return ""