def get_author_book_ratings(book_tr):
    'Get the ratings ``<span>`` element from a table ``<tr>`` element from an author page.\n\n    Args:\n        book_tr (bs4.element.Tag): ``<tr>`` book element.\n\n    Returns:\n        bs4.element.Tag: ratings ``<span>`` element.\n\n    Examples::\n        >>> for book_tr in scrape_author_books(soup):\n        ...     ratings_span = get_author_book_ratings(book_tr)\n        ...     print(ratings_span.contents[-1])\n             4.55 avg rating — 2,414 ratings\n             3.77 avg rating — 1,689 ratings\n             4.28 avg rating — 892 ratings\n             4.54 avg rating — 490 ratings\n             ...\n\n    '
    return book_tr.find('span', attrs={'class': 'minirating'})
Get the ratings ``<span>`` element from a table ``<tr>`` element from an author page.

Args:
    book_tr (bs4.element.Tag): ``<tr>`` book element.

Returns:
    bs4.element.Tag: ratings ``<span>`` element.

Examples::
    >>> for book_tr in scrape_author_books(soup):
    ...     ratings_span = get_author_book_ratings(book_tr)
    ...     print(ratings_span.contents[-1])
         4.55 avg rating — 2,414 ratings
         3.77 avg rating — 1,689 ratings
         4.28 avg rating — 892 ratings
         4.54 avg rating — 490 ratings
         ...
def get_author_book_ratings(book_tr):
    'Get the ratings ``<span>`` element from a table ``<tr>`` element from an author page.\n\n    Args:\n        book_tr (bs4.element.Tag): ``<tr>`` book element.\n\n    Returns:\n        bs4.element.Tag: ratings ``<span>`` element.\n\n    Examples::\n        >>> for book_tr in scrape_author_books(soup):\n        ...     ratings_span = get_author_book_ratings(book_tr)\n        ...     print(ratings_span.contents[-1])\n             4.55 avg rating — 2,414 ratings\n             3.77 avg rating — 1,689 ratings\n             4.28 avg rating — 892 ratings\n             4.54 avg rating — 490 ratings\n             ...\n\n    '
    return book_tr.find('span', attrs={'class': 'minirating'})