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: 是否等待成功