diff --git a/DrissionPage/chromium_tab.py b/DrissionPage/chromium_tab.py index a97c9e7..d1a39bd 100644 --- a/DrissionPage/chromium_tab.py +++ b/DrissionPage/chromium_tab.py @@ -28,6 +28,10 @@ class ChromiumTab(ChromiumBase): self.retry_interval = self.page.retry_interval self._page_load_strategy = self.page.page_load_strategy + def close(self): + """关闭当前标签页""" + self.page.close_tabs(self.tab_id) + @property def rect(self): """返回获取窗口坐标和大小的对象""" diff --git a/DrissionPage/chromium_tab.pyi b/DrissionPage/chromium_tab.pyi index 9def1d7..835776f 100644 --- a/DrissionPage/chromium_tab.pyi +++ b/DrissionPage/chromium_tab.pyi @@ -24,6 +24,8 @@ class ChromiumTab(ChromiumBase): def _set_runtime_settings(self) -> None: ... + def close(self) -> None: ... + @property def rect(self) -> ChromiumTabRect: ... diff --git a/DrissionPage/common.pyi b/DrissionPage/common.pyi index 891fe22..54677db 100644 --- a/DrissionPage/common.pyi +++ b/DrissionPage/common.pyi @@ -1,9 +1,7 @@ # -*- coding:utf-8 -*- -from FlowViewer import Listener, RequestMan +from .session_element import make_session_ele as make_session_ele -from .session_element import make_session_ele - -from .action_chains import ActionChains -from .commons.keys import Keys -from .commons.by import By -from .commons.constants import Settings +from .action_chains import ActionChains as ActionChains +from .commons.keys import Keys as Keys +from .commons.by import By as By +from .commons.constants import Settings as Settings