mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修正写法
This commit is contained in:
parent
ed2883e2b9
commit
3eee7132d5
@ -59,7 +59,7 @@ class ActionChains:
|
|||||||
cx = x + offset_x
|
cx = x + offset_x
|
||||||
cy = y + offset_y
|
cy = y + offset_y
|
||||||
|
|
||||||
self._dr.Input.dispatchMouseEvent(type='mouseMoved', x=cx, y=cy, modifiers=self.modifier)
|
self._dr.call_method('Input.dispatchMouseEvent', type='mouseMoved', x=cx, y=cy, modifiers=self.modifier)
|
||||||
self.curr_x = cx
|
self.curr_x = cx
|
||||||
self.curr_y = cy
|
self.curr_y = cy
|
||||||
return self
|
return self
|
||||||
@ -72,7 +72,8 @@ class ActionChains:
|
|||||||
"""
|
"""
|
||||||
self.curr_x += offset_x
|
self.curr_x += offset_x
|
||||||
self.curr_y += offset_y
|
self.curr_y += offset_y
|
||||||
self._dr.Input.dispatchMouseEvent(type='mouseMoved', x=self.curr_x, y=self.curr_y, modifiers=self.modifier)
|
self._dr.call_method('Input.dispatchMouseEvent', type='mouseMoved', x=self.curr_x, y=self.curr_y,
|
||||||
|
modifiers=self.modifier)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def click(self, on_ele=None):
|
def click(self, on_ele=None):
|
||||||
@ -170,8 +171,8 @@ class ActionChains:
|
|||||||
"""
|
"""
|
||||||
if on_ele:
|
if on_ele:
|
||||||
self.move_to(on_ele)
|
self.move_to(on_ele)
|
||||||
self._dr.Input.dispatchMouseEvent(type='mousePressed', button=button, clickCount=count,
|
self._dr.call_method('Input.dispatchMouseEvent', type='mousePressed', button=button, clickCount=count,
|
||||||
x=self.curr_x, y=self.curr_y, modifiers=self.modifier)
|
x=self.curr_x, y=self.curr_y, modifiers=self.modifier)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def _release(self, button):
|
def _release(self, button):
|
||||||
@ -179,8 +180,8 @@ class ActionChains:
|
|||||||
:param button: 要释放的按键
|
:param button: 要释放的按键
|
||||||
:return: self
|
:return: self
|
||||||
"""
|
"""
|
||||||
self._dr.Input.dispatchMouseEvent(type='mouseReleased', button=button, clickCount=1,
|
self._dr.call_method('Input.dispatchMouseEvent', type='mouseReleased', button=button, clickCount=1,
|
||||||
x=self.curr_x, y=self.curr_y, modifiers=self.modifier)
|
x=self.curr_x, y=self.curr_y, modifiers=self.modifier)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def scroll(self, delta_x=0, delta_y=0, on_ele=None):
|
def scroll(self, delta_x=0, delta_y=0, on_ele=None):
|
||||||
@ -192,8 +193,8 @@ class ActionChains:
|
|||||||
"""
|
"""
|
||||||
if on_ele:
|
if on_ele:
|
||||||
self.move_to(on_ele)
|
self.move_to(on_ele)
|
||||||
self._dr.Input.dispatchMouseEvent(type='mouseWheel', x=self.curr_x, y=self.curr_y,
|
self._dr.call_method('Input.dispatchMouseEvent', type='mouseWheel', x=self.curr_x, y=self.curr_y,
|
||||||
deltaX=delta_x, deltaY=delta_y, modifiers=self.modifier)
|
deltaX=delta_x, deltaY=delta_y, modifiers=self.modifier)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def up(self, pixel):
|
def up(self, pixel):
|
||||||
|
@ -476,6 +476,7 @@ class BrowserDownloadManager(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def missions(self):
|
def missions(self):
|
||||||
|
"""返回所有未完成的下载任务"""
|
||||||
return self._missions
|
return self._missions
|
||||||
|
|
||||||
def add_mission(self, mission):
|
def add_mission(self, mission):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user