import requests


def fetch(url):
    """
    Fetch a remote URL and return the contents of the page

    Parameters
    ----------
    url : str
        The URL to fetch.
        e.g. https://www.elastic.co/guide/en/apm/agent/java/current/release-notes.html  # noqa E501

    Returns
    -------
    str
        The contents of the requested web page

    Raises
    ------
    requests.exceptions.HTTPError
        If the request failed an exception will be raised.
    """
    r = requests.get(url)
    if r.status_code == r.status_code != requests.codes.ok:
        r.raise_for_status()
    return r.text