def option_in_select(browser, select_name, option):
    """
    Returns the Element specified by @option or None

    Looks at the real <select> not the select2 widget, since that doesn't
    create the DOM until we click on it.
    """

    select = find_field(browser, 'select', select_name)
    assert select, "Cannot find a '{}' select.".format(select_name)

    try:
        return select.find_element_by_xpath(str(
            './/option[normalize-space(text())=%s]' % string_literal(option)))
    except NoSuchElementException:
        return None
def option_in_select ( browser , select_name , option ) : select = find_field ( browser , 'select' , select_name ) assert select , "Cannot find a '{}' select." . format ( select_name ) try : return select . find_element_by_xpath ( str ( './/option[normalize-space(text())=%s]' % string_literal ( option ) ) ) except NoSuchElementException : return None
Returns the Element specified by @option or None

    Looks at the real <select> not the select2 widget, since that doesn't
    create the DOM until we click on it.