def get_author_book_date(book_tr):
    'Get the published date 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        int: date of publication\n\n    Examples::\n        >>> for book_tr in scrape_author_books(soup):\n        ...     book_date = get_author_book_date(book_tr)\n        ...     print(book_date)\n            None\n            None\n            1958\n            2009\n            ...\n\n    '
    book_details = book_tr.find('span', attrs={'class': 'greyText smallText uitext'})
    book_publish = book_details.contents[(- 1)].replace('—', '').replace('\n', '')
    book_date = book_publish.replace('published', '').strip()
    book_date = (eval(book_date) if (book_date != '') else None)
    return book_date
Get the published date from a table ``<tr>`` element from an author page.

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

Returns:
    int: date of publication

Examples::
    >>> for book_tr in scrape_author_books(soup):
    ...     book_date = get_author_book_date(book_tr)
    ...     print(book_date)
        None
        None
        1958
        2009
        ...
def get_author_book_date(book_tr):
    'Get the published date 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        int: date of publication\n\n    Examples::\n        >>> for book_tr in scrape_author_books(soup):\n        ...     book_date = get_author_book_date(book_tr)\n        ...     print(book_date)\n            None\n            None\n            1958\n            2009\n            ...\n\n    '
    book_details = book_tr.find('span', attrs={'class': 'greyText smallText uitext'})
    book_publish = book_details.contents[(- 1)].replace('—', ).replace('\n', )
    book_date = book_publish.replace('published', ).strip()
    book_date = (eval(book_date) if (book_date != ) else None)
    return book_date