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