def coerce_tag(tag):
    """
    Coerce a BeautifulSoup tag to its string contents (stripped from leading and trailing whitespace).

    Used by :func:`parse_status_table()` to get the text values of HTML tags.
    """
    try:
        return u''.join(tag.findAll(text=True)).strip()
    except Exception:
        return ''