增加鼠标悬停功能

This commit is contained in:
g1879 2020-07-03 11:06:26 +08:00
parent 1e75ec8814
commit 24e7406fea

View File

@ -142,6 +142,7 @@ class DriverElement(DrissionElement):
if by_js is not False:
self.run_script('arguments[0].click()')
return True
return False
def input(self, value, clear: bool = True) -> bool:
"""输入文本"""
@ -251,6 +252,11 @@ class DriverElement(DrissionElement):
return False
return True
def hover(self):
"""鼠标悬停"""
from selenium.webdriver import ActionChains
ActionChains(self._driver).move_to_element(self.inner_ele).perform()
def execute_driver_find(page_or_ele: Union[WebElement, WebDriver], loc: tuple, mode: str = 'single',
show_errmsg: bool = False, timeout: float = 10) -> Union[DriverElement, List[DriverElement]]: