📜  python selenium 选择下拉菜单 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:30.995000             🧑  作者: Mango

代码示例1
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')