Drop down box selection(Select)

Posted Lina

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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)的主要内容,如果未能解决你的问题,请参考以下文章