首页 > 代码库 > Drop down box selection(Select)

Drop down box selection(Select)

http://www.cnblogs.com/yoyoketang/p/6128636.html

from selenium.webdriver.support.select import Select
Month=driver.find_element_by_id("input-creditCardExpirationMonth")
Select(Month).select_by_value("05")
Year=driver.find_element_by_id("input-creditCardExpirationYear")
Select(Year).select_by_value("2018")
Country=driver.find_element_by_id("input-creditCardCountry") 
Select(Country).select_by_index(4)

 

Drop down box selection(Select)