Removes the specified keys from the element's attributes, and
    returns a dict containing the attributes that have been removed.

def remove_element_attributes(elem_to_parse, *args):
    """
    Removes the specified keys from the element's attributes, and
    returns a dict containing the attributes that have been removed.
    """

    element = get_element(elem_to_parse)

    if element is None:
        return element

    if len(args):
        attribs = element.attrib
        return {key: attribs.pop(key) for key in args if key in attribs}

    return {}