diff --git a/DrissionPage/chromium_base.py b/DrissionPage/chromium_base.py index 6a9d59f..64f0cc6 100644 --- a/DrissionPage/chromium_base.py +++ b/DrissionPage/chromium_base.py @@ -255,10 +255,12 @@ class ChromiumBase(BasePage): @property def size(self): - """返回页面总长高,格式:(长, 高)""" - w = self.run_js('document.body.scrollWidth;', as_expr=True) - h = self.run_js('document.body.scrollHeight;', as_expr=True) - return w, h + """返回页面总宽高,格式:(宽, 高)""" + # w = self.run_js('document.body.scrollWidth;', as_expr=True) + # h = self.run_js('document.body.scrollHeight;', as_expr=True) + # return w, h + r = self.run_cdp('Page.getLayoutMetrics', not_change=False)['contentSize'] + return r['width'], r['height'] @property def active_ele(self): diff --git a/DrissionPage/chromium_element.py b/DrissionPage/chromium_element.py index 2fe1626..7a45ef5 100644 --- a/DrissionPage/chromium_element.py +++ b/DrissionPage/chromium_element.py @@ -744,6 +744,7 @@ class ChromiumElement(DrissionElement): y += randint(-3, 4) actions.move(x - current_x, y - current_y) current_x, current_y = x, y + actions.wait(.1) actions.release() def _get_obj_id(self, node_id=None, backend_id=None):