def get_required_attribute(el, key):
    """ Get attribute key of element *el*.

    :raises:  :exc:`ValueError` if key not found
    """
    val = el.get(key)
    if val == None:
        raise ValueError('required attribute missing: ' + key)
    return val