import requests


def _get_data_from_goodreads_site(user_id, page_no):
    """Retrieve data about the statuses of a given user from the Goodreads site.
    Returns a Request object if successful, raises an Exception if not.

    :param user_id: The ID of the Goodreads user.
    :param page_no: Which page of statuses to fetch.

    """
    # user_status.list gets all the statuses by a user.
    req = requests.get('https://www.goodreads.com/user_status/list/' + user_id,
                       params={'page': str(page_no)})
    if req.status_code != 200:
        raise Exception('Unexpected error code from Goodreads API: %s\n'
                        'Error message: %r' % (req.status_code, req.text))
    return req