From 03ae186f069ee1e54f562d4e131d5b6a647849de Mon Sep 17 00:00:00 2001 From: g1879 Date: Tue, 22 Aug 2023 23:56:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/chromium_base.py | 2 +- DrissionPage/chromium_frame.py | 4 ++-- DrissionPage/waiter.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DrissionPage/chromium_base.py b/DrissionPage/chromium_base.py index 283c199..e8bd861 100644 --- a/DrissionPage/chromium_base.py +++ b/DrissionPage/chromium_base.py @@ -159,7 +159,7 @@ class ChromiumBase(BasePage): self._is_reading = False def _wait_loaded(self, timeout=None): - """等待页面加载完成 + """等待页面加载完成,超时触发停止加载 :param timeout: 超时时间 :return: 是否成功,超时返回False """ diff --git a/DrissionPage/chromium_frame.py b/DrissionPage/chromium_frame.py index 34aa115..5fe0031 100644 --- a/DrissionPage/chromium_frame.py +++ b/DrissionPage/chromium_frame.py @@ -80,7 +80,7 @@ class ChromiumFrame(ChromiumBase): """重新获取document""" debug = self._debug if debug: - print('reload') + print('重新获取document') self._frame_ele = ChromiumElement(self.page, backend_id=self._backend_id) node = self.page.run_cdp('DOM.describeNode', backendNodeId=self._frame_ele.ids.backend_id)['node'] @@ -568,7 +568,7 @@ class ChromiumFrame(ChromiumBase): for t in range(times + 1): err = None - result = self.driver.Page.navigate(url=to_url, frameId=self.frame_id) + result = self.driver.call_method('Page.navigate', url=to_url, frameId=self.frame_id) is_timeout = not self._wait_loaded(timeout) sleep(.5) diff --git a/DrissionPage/waiter.py b/DrissionPage/waiter.py index 25b98a1..0df8fb0 100644 --- a/DrissionPage/waiter.py +++ b/DrissionPage/waiter.py @@ -66,7 +66,7 @@ class ChromiumBaseWaiter(object): return self._loading(timeout=timeout, gap=.002, raise_err=raise_err) def load_complete(self, timeout=None, raise_err=None): - """等待页面开始加载 + """等待页面加载完成 :param timeout: 超时时间,为None时使用页面timeout属性 :param raise_err: 等待失败时是否报错,为None时根据Settings设置 :return: 是否等待成功