from bs4 import BeautifulSoup


def get_table_rows(fname="stats.html"):
    """
    Extract the table rows from the statistics

    :param fname: string name of the file stored in `data` directory

    :return table_rows: list of BeautifulSoup objects to be passed to `process_in_parallel`
    """

    soup = BeautifulSoup(open(f"data/{fname}", "r", encoding="utf8"), features="lxml")
    table_rows = soup.find_all(attrs={"class": "sortableTable-row js-statsTableRow"})
    print(f"Found {len(table_rows)} entries in table.")
    return table_rows