def define_output(element, output, key=None):
    """
    Defines get_element_content output
    :param element: soup html tag
    :param output: String defining returned format
    :param key: Key for element attribute
    :return: Element content or None
    """
    options = {'t': element.text.strip(), 'k': element[key] if element.
        has_attr(key) else None}
    return options[output]
