要从 Multi Select 元素中选择多个 选项 ,可以使用 ActionChains 模拟 *
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
myElemA = driver.find_element_by_css_selector(".rowStyle1:nth-child(6) .gwt-List@R_463_2419@ option[value='P0_English']")
myElemB = driver.find_element_by_css_selector(".rowStyle1:nth-child(6) .gwt-List@R_463_2419@ option[value='P1_English']")
myElemC = driver.find_element_by_css_selector(".rowStyle1:nth-child(6) .gwt-List@R_463_2419@ option[value='P5_English']")
ActionChains(driver).key_down(Keys.CONTROL).click(myElemA).key_up(Keys.CONTROL).perform()
ActionChains(driver).key_down(Keys.CONTROL).click(myElemB).key_up(Keys.CONTROL).perform()
ActionChains(driver).key_down(Keys.CONTROL).click(myElemC).key_up(Keys.CONTROL).perform()