select element from dropdown selenium python code example

Example 1: python selenium select dropdown

from selenium import webdriver
from selenium.webdriver.support.ui import Select

driver = webdriver.Firefox()
driver.get('url')

select = Select(driver.find_element_by_id('fruits01'))

# select by visible text
select.select_by_visible_text('Banana')

# select by value 
select.select_by_value('1')

Example 2: select dropdown selenium

How do you handle Select type of dropdown?
    - If it is  web element.
    -> return type: List

Tags:

Misc Example