diff --git a/DrissionPage/_elements/chromium_element.pyi b/DrissionPage/_elements/chromium_element.pyi index 09ab107..225c30f 100644 --- a/DrissionPage/_elements/chromium_element.pyi +++ b/DrissionPage/_elements/chromium_element.pyi @@ -550,10 +550,21 @@ class ChromiumElement(DrissionElement): """使元素获取焦点""" ... - def hover(self, offset_x: int = None, offset_y: int = None) -> ChromiumElement: - """鼠标悬停,可接受偏移量,偏移量相对于元素左上角坐标。不传入offset_x和offset_y值时悬停在元素中点 + def force_pseudo_state(self, keep_state: bool = True, + forcedPseudoClasses: list[str] = ['hover']) -> ChromiumElement: + """ + 强制元素保持状态,如鼠标悬停,keep_state为True时需再次调用取消强制元素保持状态 + :param keep_state: 是否强制元素保持某个状态,默认为True + :param forcedPseudoClasses: 默认为['hover'],可用参数:active,hover,focus,focus-within,focus-visible,target + :return: None + """ + ... + + def hover(self, offset_x: int = None, offset_y: int = None, keep_hover: bool = False) -> ChromiumElement: + """鼠标悬停,可接受偏移量,偏移量相对于元素左上角坐标。不传入offset_x和offset_y值时悬停在元素中点,keep_hover为True时需再次调用取消强制hover :param offset_x: 相对元素左上角坐标的x轴偏移量 :param offset_y: 相对元素左上角坐标的y轴偏移量 + :param keep_hover: 为True时保持元素hover时的样式,为False时取消强制hover :return: None """ ...