getting current <select> value from drop-down menu with Python Selenium
user_defined_type_dropdown_element
is the <select>
tag, that is why you are getting all the options when printing it. If you want the selected option use Select
class and first_selected_option
# initialize Select object
select = Select(user_defined_type_dropdown_element)
# to print the text
print select.first_selected_option.text
# to print the value
print select.first_selected_option.get_attribute("value")