import requests
from bs4 import BeautifulSoup


def player_href_list_grab(year):
    """Grabs a list of hrefs for a given year based on descending fantasy performance"""
    url = f'https://www.pro-football-reference.com/years/{year}/fantasy.htm'
    r = requests.get(url)
    soup = BeautifulSoup(r.content, 'html.parser')
    table = soup.find_all('table')[0]
    a = table.find_all('a')
    href_list = [i.get('href') for i in a if 'players' in str(i)]
    return href_list