有以下几种方法可用:
(以py脚本为例,其他语言类似。)
1.
driver.find_element_by_id("id =aaa").find_elements_by_tag_name("option")[1].click();
2.
select=driver.find_element_by_xpath("//select[@id='ShippingMethod']")
select.find_element_by_xpath("//option[@value='8.34']").click()
3.
from selenium.webdriver.support.ui import Select
select = Select(driver.find_element_by_tag_name("select"))
select.deselect_all()
select.select_by_visible_text("Edam")
阅读(831) | 评论(0) | 转发(0) |