擅长:python、mysql、java
<p>试试这个(ref:<a href="http://allselenium.info/mouse-over-actions-using-python-selenium-webdriver/" rel="nofollow noreferrer">http://allselenium.info/mouse-over-actions-using-python-selenium-webdriver/</a>)</p>
<pre><code>from selenium.webdriver.common.action_chains import ActionChains
action = ActionChains(driver)
firstLevelMenu = driver.find_element_by_id("yui_3_7_0_4_1390312781452_393") #id of menu, or xpath of menu, whatever
action.move_to_element(firstLevelMenu).perform()
secondLevelMenu = driver.find_element_by_xpath("XPATH_OF_OFFERED")
action.move_to_element(secondLevelMenu).perform()
secondLevelMenu.click()
</code></pre>