import re


def get_published_year_from_soup(soup):
    """Get the publication year of a book.

    Parameters
    ----------
    soup : BeautifulSoup
        BeautifulSoup object created from a book page.

    Returns
    -------
    int
        Book publication year.
    None
        Publication year not found.
    """
    details = soup.find(id='details').find_all('div')[1].get_text()
    result = re.search('[1-3][0-9]{3}', details)
    return None if result is None else int(result.group())