Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Selenium-3 Mouse event

Shulou Source: shulou.com Published: 2022-06-03 08:06:05 11月23日 Update

Example:

From selenium import webdriver

B = webdriver.Firefox ()

B.get ("http://edu.51cto.com/courselist/index.html")"

Ele = b.find_element_by_link_text ("find courses") # locate and find course elements

From selenium.webdriver.common.actiton_chains import ActionChains

ActionChains (b) .move_to_element (ele). Perform () # simulates that a drop-down menu appears when you hover over "find a course"

Ele1 = b.find_element_by_link_text ("artificial intelligence") # locate "artificial intelligence" in the drop-down menu

Ele1.click ()

Tags: Courses artificial intelligence intelligence menus drop-down positioning mouse elements events Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple Redmi OPPO Reno Microsoft