From 21d5878e9013a9b4fab2f1a7d8cc8d07ac531fd3 Mon Sep 17 00:00:00 2001 From: g1879 Date: Tue, 6 Dec 2022 17:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/chromium_base.py | 6 ++---- DrissionPage/chromium_element.py | 2 +- DrissionPage/session_page.py | 1 + DrissionPage/web_page.py | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/DrissionPage/chromium_base.py b/DrissionPage/chromium_base.py index 23d3dc7..46429a8 100644 --- a/DrissionPage/chromium_base.py +++ b/DrissionPage/chromium_base.py @@ -116,16 +116,14 @@ class ChromiumBase(BasePage): return False def _onFrameStartedLoading(self, **kwargs): - """页面跳转时触发""" - # print('FrameStartedLoading') + """页面开始加载时触发""" if kwargs['frameId'] == self.tab_id: self._is_loading = True if self._debug: print('FrameStartedLoading') def _onFrameStoppedLoading(self, **kwargs): - """页面跳转时触发""" - # print('FrameStoppedLoading') + """页面加载完成后触发""" if kwargs['frameId'] == self.tab_id and self._first_run is False and self._is_loading: if self._debug: print('FrameStoppedLoading') diff --git a/DrissionPage/chromium_element.py b/DrissionPage/chromium_element.py index 703659e..e2066c9 100644 --- a/DrissionPage/chromium_element.py +++ b/DrissionPage/chromium_element.py @@ -32,7 +32,7 @@ class ChromiumElement(DrissionElement): self._scroll = None self._tag = None if not node_id and not obj_id: - raise TypeError('node_id或obj_id必须传入一个。') + raise RuntimeError('元素可能已失效。') if node_id: self._node_id = node_id diff --git a/DrissionPage/session_page.py b/DrissionPage/session_page.py index ce9ac6f..b4ad6f8 100644 --- a/DrissionPage/session_page.py +++ b/DrissionPage/session_page.py @@ -194,6 +194,7 @@ class SessionPage(BasePage): @property def download(self) -> DownloadKit: + """返回下载器对象""" if not hasattr(self, '_download_kit'): self._download_kit = DownloadKit(session=self) diff --git a/DrissionPage/web_page.py b/DrissionPage/web_page.py index d3b2c3c..0244d0c 100644 --- a/DrissionPage/web_page.py +++ b/DrissionPage/web_page.py @@ -383,6 +383,7 @@ class WebPage(SessionPage, ChromiumPage, BasePage): @property def download(self) -> DownloadKit: + """返回下载器对象""" if self.mode == 'd': self.cookies_to_session() return super().download