下拉菜单的选取

例如:https://www.baidu.com/

设置-搜索设置:每页显示10条设置为每页显示20条的方法:

1.driver.find_element_by_xpath(".//*[@id='nr']/option[2]").click()
2.Select(driver.find_element_by_id("nr")).select_by_visible_text(u"每页显示20条")

3.Select(driver.find_element_by_id('nr')).select_by_index(1)

4.Select(driver.find_element_by_id('nr')).select_by_value('20')

posted @ 2017-11-29 17:57  JodieWang  阅读(176)  评论(0编辑  收藏  举报