mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
微调
This commit is contained in:
parent
a3bb84e7e0
commit
e707ecb1ca
@ -255,10 +255,12 @@ class ChromiumBase(BasePage):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def size(self):
|
def size(self):
|
||||||
"""返回页面总长高,格式:(长, 高)"""
|
"""返回页面总宽高,格式:(宽, 高)"""
|
||||||
w = self.run_js('document.body.scrollWidth;', as_expr=True)
|
# w = self.run_js('document.body.scrollWidth;', as_expr=True)
|
||||||
h = self.run_js('document.body.scrollHeight;', as_expr=True)
|
# h = self.run_js('document.body.scrollHeight;', as_expr=True)
|
||||||
return w, h
|
# return w, h
|
||||||
|
r = self.run_cdp('Page.getLayoutMetrics', not_change=False)['contentSize']
|
||||||
|
return r['width'], r['height']
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def active_ele(self):
|
def active_ele(self):
|
||||||
|
@ -744,6 +744,7 @@ class ChromiumElement(DrissionElement):
|
|||||||
y += randint(-3, 4)
|
y += randint(-3, 4)
|
||||||
actions.move(x - current_x, y - current_y)
|
actions.move(x - current_x, y - current_y)
|
||||||
current_x, current_y = x, y
|
current_x, current_y = x, y
|
||||||
|
actions.wait(.1)
|
||||||
actions.release()
|
actions.release()
|
||||||
|
|
||||||
def _get_obj_id(self, node_id=None, backend_id=None):
|
def _get_obj_id(self, node_id=None, backend_id=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user