import requests


def fetch_website(date):
    """
    Fetch the website containing the data from ENTSOE.EU

    Parameters
    ----------
    date: something datetime-like

    Returns
    -------
    str
    """
    # the date needs to look like 24.02.2016 for the url
    formatted_date = date.strftime("%d.%m.%Y")
    url = "https://transparency.entsoe.eu/transmission-domain/r2/dayAheadPrices/show?name=&defaultValue=false&viewType=TABLE&areaType=BZN&atch=false&dateTime.dateTime={}+00:00|CET|DAY&biddingZone.values=CTY|10YBE----------2!BZN|10YBE----------2&dateTime.timezone=CET_CEST&dateTime.timezone_input=CET+(UTC+1)+/+CEST+(UTC+2)".format(
        formatted_date)

    r = requests.get(url)

    if r.status_code == 200:
        return r.text
    else:
        raise Exception("Seems like you got code {}".format(r.status_code))