move_to_element 下拉菜单出不来。

from selenium import webdriver
import time

import ActionChains

from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome()
driver.get("http://www.baidu.com")

locate hover element

above = driver.find_element_by_css_selector(".lb")

time.sleep(5)

hover the hover element

ActionChains(driver).move_to_element(above).perform()
driver.quit()

你可能感兴趣的:(move_to_element 下拉菜单出不来。)