import re


def get_days_left_on_sale(game_page):
    """
    Returns the number of days left on sale if available
    """

    days_left_on_sale_containers = game_page.find_all(
        "span", {"class": "caption text-muted", "aria-live": "polite"}
    )

    if days_left_on_sale_containers:
        try:
            days_left_on_sale = re.findall(
                r"\d+.days?.left", str(days_left_on_sale_containers[0])
            )

            return re.findall(r"\d+", days_left_on_sale[0])[0]

        except IndexError:

            return None

    return None