def node_int(node):
    """Returns stripped node text as int, or None."""

    if node is None:
        return None
    text = node.text.strip()
    if text.lower() == 'none':
        return None
    if len(text):
        return int(text)
    return None