from bs4 import BeautifulSoup
from typing import Optional
from typing import Dict


def get_text(
        bs: BeautifulSoup,
        *,
        name: str,
        attrs: Optional[Dict]
) -> str:
    """
    Parameters
    ----------
    bs : BeautifulSoup
        Object wrapping some html content
    name
    attrs
        Parameters to bs
    Returns
    -------
    str
        Text wrapped by the soup request or a default string if soup is None
    """
    soup = bs.find(name=name, attrs=attrs)
    return soup.text if soup is not None else "Info not available"