diff --git a/DrissionPage/__init__.py b/DrissionPage/__init__.py index c71f14a..a176375 100644 --- a/DrissionPage/__init__.py +++ b/DrissionPage/__init__.py @@ -9,8 +9,7 @@ from ._base.chromium import Chromium from ._configs.chromium_options import ChromiumOptions from ._configs.session_options import SessionOptions from ._pages.chromium_page import ChromiumPage -from ._pages.mix_page import MixPage -from ._pages.mix_page import MixPage as WebPage from ._pages.session_page import SessionPage +from ._pages.web_page import WebPage __version__ = '4.1.0.0b21' diff --git a/DrissionPage/__init__.pyi b/DrissionPage/__init__.pyi index 79facd7..4271c2b 100644 --- a/DrissionPage/__init__.pyi +++ b/DrissionPage/__init__.pyi @@ -9,9 +9,8 @@ from ._base.chromium import Chromium from ._configs.chromium_options import ChromiumOptions from ._configs.session_options import SessionOptions from ._pages.chromium_page import ChromiumPage -from ._pages.mix_page import MixPage -from ._pages.mix_page import MixPage as WebPage from ._pages.session_page import SessionPage +from ._pages.web_page import WebPage -__all__ = ['MixPage', 'WebPage', 'ChromiumPage', 'Chromium', 'ChromiumOptions', 'SessionOptions', 'SessionPage', '__version__'] +__all__ = ['WebPage', 'ChromiumPage', 'Chromium', 'ChromiumOptions', 'SessionOptions', 'SessionPage', '__version__'] __version__: str = ... diff --git a/DrissionPage/_base/base.pyi b/DrissionPage/_base/base.pyi index a509972..af376f0 100644 --- a/DrissionPage/_base/base.pyi +++ b/DrissionPage/_base/base.pyi @@ -15,8 +15,8 @@ from .._elements.session_element import SessionElement from .._functions.elements import SessionElementsList from .._pages.chromium_frame import ChromiumFrame from .._pages.chromium_page import ChromiumPage -from .._pages.mix_page import MixPage from .._pages.session_page import SessionPage +from .._pages.web_page import WebPage class BaseParser(object): @@ -338,7 +338,7 @@ class BasePage(BaseParser): _DownloadKit: Optional[DownloadKit] = ... _none_ele_return_value: bool = ... _none_ele_value: Any = ... - _page: Union[ChromiumPage, SessionPage, MixPage] = ... + _page: Union[ChromiumPage, SessionPage, WebPage] = ... def __init__(self): ... diff --git a/DrissionPage/_base/chromium.pyi b/DrissionPage/_base/chromium.pyi index 0401ef8..d94cf6b 100644 --- a/DrissionPage/_base/chromium.pyi +++ b/DrissionPage/_base/chromium.pyi @@ -225,7 +225,7 @@ class Chromium(object): background: bool = False, new_context: bool = False) -> Union[ChromiumTab, MixTab]: """新建一个标签页 - :param obj: 要创建的Tab类型 + :param mix: 是否创建MixTab :param url: 新标签页跳转到的网址 :param new_window: 是否在新窗口打开标签页 :param background: 是否不激活新标签页,如new_window为True则无效 diff --git a/DrissionPage/_base/driver.pyi b/DrissionPage/_base/driver.pyi index cf9bcee..4cb69b4 100644 --- a/DrissionPage/_base/driver.pyi +++ b/DrissionPage/_base/driver.pyi @@ -12,7 +12,7 @@ from typing import Union, Callable, Dict, Optional from requests import Response from websocket import WebSocket -from .browser import Chromium +from .._base.chromium import Chromium class Driver(object): diff --git a/DrissionPage/_elements/chromium_element.py b/DrissionPage/_elements/chromium_element.py index bc58510..8b6d6e2 100644 --- a/DrissionPage/_elements/chromium_element.py +++ b/DrissionPage/_elements/chromium_element.py @@ -27,8 +27,8 @@ from .._units.selector import SelectElement from .._units.setter import ChromiumElementSetter from .._units.states import ElementStates, ShadowRootStates from .._units.waiter import ElementWaiter -from ..errors import ContextLostError, ElementLostError, JavaScriptError, CDPError, NoResourceError, AlertExistsError, \ - NoRectError +from ..errors import (ContextLostError, ElementLostError, JavaScriptError, CDPError, NoResourceError, + AlertExistsError, NoRectError) __FRAME_ELEMENT__ = ('iframe', 'frame') diff --git a/DrissionPage/_elements/chromium_element.pyi b/DrissionPage/_elements/chromium_element.pyi index 6b44613..8ada2b8 100644 --- a/DrissionPage/_elements/chromium_element.pyi +++ b/DrissionPage/_elements/chromium_element.pyi @@ -15,7 +15,7 @@ from .._pages.chromium_base import ChromiumBase from .._pages.chromium_frame import ChromiumFrame from .._pages.chromium_page import ChromiumPage from .._pages.chromium_tab import ChromiumTab -from .._pages.mix_page import MixPage +from .._pages.web_page import WebPage from .._units.clicker import Clicker from .._units.rect import ElementRect from .._units.scroller import ElementScroller @@ -30,7 +30,7 @@ PIC_TYPE = Literal['jpg', 'jpeg', 'png', 'webp', True] class ChromiumElement(DrissionElement): _tag: Optional[str] = ... owner: ChromiumBase = ... - page: Union[ChromiumPage, MixPage] = ... + page: Union[ChromiumPage, WebPage] = ... tab: Union[ChromiumPage, ChromiumTab] = ... _node_id: int = ... _obj_id: str = ... @@ -898,7 +898,7 @@ def find_by_css(ele: ChromiumElement, ... -def make_chromium_eles(page: Union[ChromiumBase, ChromiumPage, MixPage, ChromiumTab, ChromiumFrame], +def make_chromium_eles(page: Union[ChromiumBase, ChromiumPage, WebPage, ChromiumTab, ChromiumFrame], _ids: Union[tuple, list, str, int], index: Optional[int] = 1, is_obj_id: bool = True, diff --git a/DrissionPage/_pages/chromium_base.pyi b/DrissionPage/_pages/chromium_base.pyi index 37c1b2b..e73aeff 100644 --- a/DrissionPage/_pages/chromium_base.pyi +++ b/DrissionPage/_pages/chromium_base.pyi @@ -10,8 +10,8 @@ from typing import Union, Tuple, Any, Optional, Literal from .chromium_page import ChromiumPage from .chromium_tab import ChromiumTab -from .mix_page import MixPage from .mix_tab import MixTab +from .web_page import WebPage from .._base.base import BasePage from .._base.chromium import Chromium from .._base.driver import Driver @@ -34,7 +34,7 @@ PIC_TYPE = Literal['jpg', 'jpeg', 'png', 'webp', True] class ChromiumBase(BasePage): - _tab: Union[ChromiumTab, MixTab, ChromiumFrame, ChromiumPage, MixPage] = ... + _tab: Union[ChromiumTab, MixTab, ChromiumFrame, ChromiumPage, WebPage] = ... _browser: Chromium = ... _driver: Optional[Driver] = ... _frame_id: str = ... diff --git a/DrissionPage/_pages/mix_page.py b/DrissionPage/_pages/web_page.py similarity index 97% rename from DrissionPage/_pages/mix_page.py rename to DrissionPage/_pages/web_page.py index 9f1c1f3..fbcc035 100644 --- a/DrissionPage/_pages/mix_page.py +++ b/DrissionPage/_pages/web_page.py @@ -11,10 +11,10 @@ from .._base.base import BasePage from .._configs.chromium_options import ChromiumOptions from .._functions.cookies import set_session_cookies, set_tab_cookies from .._functions.settings import Settings -from .._units.setter import MixPageSetter +from .._units.setter import WebPageSetter -class MixPage(SessionPage, ChromiumPage, BasePage): +class WebPage(SessionPage, ChromiumPage, BasePage): """整合浏览器和request的页面类""" def __new__(cls, mode='d', timeout=None, chromium_options=None, session_or_options=None): @@ -42,7 +42,7 @@ class MixPage(SessionPage, ChromiumPage, BasePage): chromium_options = ChromiumOptions(read_file=chromium_options) chromium_options.set_timeouts(base=self._timeout).set_paths(download_path=self.download_path) super(SessionPage, self).__init__(addr_or_opts=chromium_options, timeout=timeout) - self._type = 'MixPage' + self._type = 'WebPage' self.change_mode(mode, go=False, copy_cookies=False) def __call__(self, locator, index=1, timeout=None): @@ -57,7 +57,7 @@ class MixPage(SessionPage, ChromiumPage, BasePage): @property def set(self): if self._set is None: - self._set = MixPageSetter(self) + self._set = WebPageSetter(self) return self._set @property @@ -252,4 +252,4 @@ class MixPage(SessionPage, ChromiumPage, BasePage): self._has_driver = None def __repr__(self): - return f'' + return f'' diff --git a/DrissionPage/_pages/mix_page.pyi b/DrissionPage/_pages/web_page.pyi similarity index 98% rename from DrissionPage/_pages/mix_page.pyi rename to DrissionPage/_pages/web_page.pyi index baf99e7..7756fc9 100644 --- a/DrissionPage/_pages/mix_page.pyi +++ b/DrissionPage/_pages/web_page.pyi @@ -20,13 +20,13 @@ from .._configs.session_options import SessionOptions from .._elements.chromium_element import ChromiumElement from .._elements.session_element import SessionElement from .._functions.elements import SessionElementsList, ChromiumElementsList -from .._units.setter import MixPageSetter -from .._units.waiter import MixPageWaiter +from .._units.setter import WebPageSetter +from .._units.waiter import WebPageWaiter -class MixPage(SessionPage, ChromiumPage, BasePage): +class WebPage(SessionPage, ChromiumPage, BasePage): _d_mode: bool = ... - _set: MixPageSetter = ... + _set: WebPageSetter = ... _has_driver: Optional[bool] = ... _has_session: Optional[bool] = ... _session_options: Union[SessionOptions, None] = ... @@ -58,18 +58,18 @@ class MixPage(SessionPage, ChromiumPage, BasePage): ... @property - def latest_tab(self) -> Union[MixTab, MixPage, str]: + def latest_tab(self) -> Union[MixTab, WebPage, str]: """返回最新的标签页,最新标签页指最后创建或最后被激活的 当Settings.singleton_tab_obj==True时返回Tab对象,否则返回tab id""" ... @property - def set(self) -> MixPageSetter: + def set(self) -> WebPageSetter: """返回用于设置的对象""" ... @property - def wait(self) -> MixPageWaiter: + def wait(self) -> WebPageWaiter: """返回用于等待的对象""" ... diff --git a/DrissionPage/_units/cookies_setter.py b/DrissionPage/_units/cookies_setter.py index 38f64c1..651d26d 100644 --- a/DrissionPage/_units/cookies_setter.py +++ b/DrissionPage/_units/cookies_setter.py @@ -56,7 +56,7 @@ class SessionCookiesSetter(object): self._owner.session.cookies.clear() -class MixPageCookiesSetter(CookiesSetter, SessionCookiesSetter): +class WebPageCookiesSetter(CookiesSetter, SessionCookiesSetter): def __call__(self, cookies): if self._owner.mode == 'd' and self._owner._has_driver: diff --git a/DrissionPage/_units/cookies_setter.pyi b/DrissionPage/_units/cookies_setter.pyi index 4301e40..a90ad61 100644 --- a/DrissionPage/_units/cookies_setter.pyi +++ b/DrissionPage/_units/cookies_setter.pyi @@ -10,9 +10,9 @@ from typing import Union from .._base.chromium import Chromium from .._pages.chromium_base import ChromiumBase -from .._pages.mix_page import MixPage from .._pages.mix_tab import MixTab from .._pages.session_page import SessionPage +from .._pages.web_page import WebPage class BrowserCookiesSetter(object): @@ -99,12 +99,12 @@ class SessionCookiesSetter(object): ... -class MixPageCookiesSetter(CookiesSetter, SessionCookiesSetter): - _owner: Union[MixPage, MixTab] = ... +class WebPageCookiesSetter(CookiesSetter, SessionCookiesSetter): + _owner: Union[WebPage, MixTab] = ... - def __init__(self, owner: Union[MixPage, MixTab]): + def __init__(self, owner: Union[WebPage, MixTab]): """ - :param owner: MixPage, MixTab对象 + :param owner: WebPage, MixTab对象 """ ... diff --git a/DrissionPage/_units/rect.pyi b/DrissionPage/_units/rect.pyi index 0a1a8c7..93a8b1f 100644 --- a/DrissionPage/_units/rect.pyi +++ b/DrissionPage/_units/rect.pyi @@ -12,8 +12,8 @@ from .._pages.chromium_base import ChromiumBase from .._pages.chromium_frame import ChromiumFrame from .._pages.chromium_page import ChromiumPage from .._pages.chromium_tab import ChromiumTab -from .._pages.mix_page import MixPage from .._pages.mix_tab import MixTab +from .._pages.web_page import WebPage class ElementRect(object): @@ -110,7 +110,7 @@ class TabRect(object): """ :param owner: Page对象和Tab对象 """ - self._owner: Union[ChromiumPage, ChromiumTab, MixPage, MixTab] = ... + self._owner: Union[ChromiumPage, ChromiumTab, WebPage, MixTab] = ... @property def window_state(self) -> str: diff --git a/DrissionPage/_units/scroller.pyi b/DrissionPage/_units/scroller.pyi index 1a4a5bd..03fa308 100644 --- a/DrissionPage/_units/scroller.pyi +++ b/DrissionPage/_units/scroller.pyi @@ -12,8 +12,8 @@ from .._pages.chromium_base import ChromiumBase from .._pages.chromium_frame import ChromiumFrame from .._pages.chromium_page import ChromiumPage from .._pages.chromium_tab import ChromiumTab -from .._pages.mix_page import MixPage from .._pages.mix_tab import MixTab +from .._pages.web_page import WebPage class Scroller(object): @@ -186,7 +186,7 @@ class PageScroller(Scroller): def to_see(self, loc_or_ele: Union[str, tuple, ChromiumElement], - center: Union[bool, None] = None) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + center: Union[bool, None] = None) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """滚动页面直到元素可见 :param loc_or_ele: 元素的定位信息,可以是loc元组,或查询字符串 :param center: 是否尽量滚动到页面正中,为None时如果被遮挡,则滚动到页面正中 @@ -194,27 +194,27 @@ class PageScroller(Scroller): """ ... - def to_top(self) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def to_top(self) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """滚动到顶端,水平位置不变""" ... - def to_bottom(self) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def to_bottom(self) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """滚动到底端,水平位置不变""" ... - def to_half(self) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def to_half(self) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """滚动到垂直中间位置,水平位置不变""" ... - def to_rightmost(self) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def to_rightmost(self) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """滚动到最右边,垂直位置不变""" ... - def to_leftmost(self) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def to_leftmost(self) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """滚动到最左边,垂直位置不变""" ... - def to_location(self, x: int, y: int) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def to_location(self, x: int, y: int) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """滚动到指定位置 :param x: 水平距离 :param y: 垂直距离 @@ -222,28 +222,28 @@ class PageScroller(Scroller): """ ... - def up(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def up(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """向上滚动若干像素,水平位置不变 :param pixel: 滚动的像素 :return: None """ ... - def down(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def down(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """向下滚动若干像素,水平位置不变 :param pixel: 滚动的像素 :return: None """ ... - def left(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def left(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """向左滚动若干像素,垂直位置不变 :param pixel: 滚动的像素 :return: None """ ... - def right(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, MixPage]: + def right(self, pixel: int = 300) -> Union[ChromiumTab, MixTab, ChromiumPage, WebPage]: """向右滚动若干像素,垂直位置不变 :param pixel: 滚动的像素 :return: None diff --git a/DrissionPage/_units/setter.py b/DrissionPage/_units/setter.py index a3185f0..731732d 100644 --- a/DrissionPage/_units/setter.py +++ b/DrissionPage/_units/setter.py @@ -10,7 +10,7 @@ from time import sleep from requests.structures import CaseInsensitiveDict -from .cookies_setter import SessionCookiesSetter, CookiesSetter, MixPageCookiesSetter, BrowserCookiesSetter +from .cookies_setter import SessionCookiesSetter, CookiesSetter, WebPageCookiesSetter, BrowserCookiesSetter from .._functions.tools import show_or_hide_browser from .._functions.web import format_headers from ..errors import ElementLostError, JavaScriptError @@ -235,8 +235,8 @@ class TabSetter(ChromiumBaseSetter): self._owner.browser._dl_mgr.set_rename(self._owner.tab_id, name, suffix) def when_download_file_exists(self, mode): - types = {'rename': 'rename', 'overwrite': 'overwrite', 'skip': 'skip', 'r': 'rename', 'o': 'overwrite', - 's': 'skip'} + types = {'rename': 'rename', 'overwrite': 'overwrite', 'skip': 'skip', + 'r': 'rename', 'o': 'overwrite', 's': 'skip'} mode = types.get(mode, mode) if mode not in types: raise ValueError(f'''mode参数只能是 '{"', '".join(types.keys())}' 之一,现在是:{mode}''') @@ -266,7 +266,7 @@ class ChromiumPageSetter(TabSetter): self._owner.browser._download_path = self._owner._download_path -class MixPageSetter(ChromiumPageSetter): +class WebPageSetter(ChromiumPageSetter): def __init__(self, owner): super().__init__(owner) self._session_setter = SessionPageSetter(self._owner) @@ -275,7 +275,7 @@ class MixPageSetter(ChromiumPageSetter): @property def cookies(self): if self._cookies_setter is None: - self._cookies_setter = MixPageCookiesSetter(self._owner) + self._cookies_setter = WebPageCookiesSetter(self._owner) return self._cookies_setter def headers(self, headers): @@ -300,19 +300,19 @@ class MixTabSetter(TabSetter): @property def cookies(self): if self._cookies_setter is None: - self._cookies_setter = MixPageCookiesSetter(self._owner) + self._cookies_setter = WebPageCookiesSetter(self._owner) return self._cookies_setter def headers(self, headers): - if self._owner._has_session: + if self._owner._session: self._session_setter.headers(headers) - if self._owner._has_driver: + if self._owner._driver and self._owner._driver.is_running: self._chromium_setter.headers(headers) def user_agent(self, ua, platform=None): - if self._owner._has_session: + if self._owner._session: self._session_setter.user_agent(ua) - if self._owner._has_driver: + if self._owner._driver and self._owner._driver.is_running: self._chromium_setter.user_agent(ua, platform) def timeouts(self, base=None, page_load=None, script=None): @@ -370,7 +370,7 @@ class LoadMode(object): if value.lower() not in ('normal', 'eager', 'none'): raise ValueError("只能选择 'normal', 'eager', 'none'。") self._owner._load_mode = value - if self._owner._type in ('ChromiumPage', 'MixPage'): + if self._owner._type in ('ChromiumPage', 'WebPage'): self._owner.browser._load_mode = value def normal(self): diff --git a/DrissionPage/_units/setter.pyi b/DrissionPage/_units/setter.pyi index 9849c01..b2890b9 100644 --- a/DrissionPage/_units/setter.pyi +++ b/DrissionPage/_units/setter.pyi @@ -11,7 +11,7 @@ from typing import Union, Tuple, Literal, Any, Optional from requests.adapters import HTTPAdapter from requests.auth import HTTPBasicAuth -from .cookies_setter import SessionCookiesSetter, CookiesSetter, MixPageCookiesSetter, BrowserCookiesSetter +from .cookies_setter import SessionCookiesSetter, CookiesSetter, WebPageCookiesSetter, BrowserCookiesSetter from .scroller import PageScroller from .._base.base import BasePage from .._base.chromium import Chromium @@ -20,9 +20,9 @@ from .._pages.chromium_base import ChromiumBase from .._pages.chromium_frame import ChromiumFrame from .._pages.chromium_page import ChromiumPage from .._pages.chromium_tab import ChromiumTab -from .._pages.mix_page import MixPage from .._pages.mix_tab import MixTab from .._pages.session_page import SessionPage +from .._pages.web_page import WebPage FILE_EXISTS = Literal['skip', 'rename', 'overwrite', 's', 'r', 'o'] @@ -403,19 +403,19 @@ class ChromiumPageSetter(TabSetter): ... -class MixPageSetter(ChromiumPageSetter): - _owner: MixPage = ... +class WebPageSetter(ChromiumPageSetter): + _owner: WebPage = ... _session_setter: SessionPageSetter = ... _chromium_setter: ChromiumPageSetter = ... - def __init__(self, owner: MixPage): + def __init__(self, owner: WebPage): """ - :param owner: MixPage对象 + :param owner: WebPage对象 """ ... @property - def cookies(self) -> MixPageCookiesSetter: + def cookies(self) -> WebPageCookiesSetter: """返回用于设置cookies的对象""" ... @@ -432,7 +432,7 @@ class MixTabSetter(TabSetter): ... @property - def cookies(self) -> MixPageCookiesSetter: + def cookies(self) -> WebPageCookiesSetter: """返回用于设置cookies的对象""" ... @@ -535,7 +535,7 @@ class LoadMode(object): """ ... - def __call__(self, value: str) -> None: + def __call__(self, value: Literal['normal', 'eager', 'none']) -> None: """设置加载策略 :param value: 可选 'normal', 'eager', 'none' :return: None diff --git a/DrissionPage/_units/waiter.pyi b/DrissionPage/_units/waiter.pyi index f0f3328..c8febe6 100644 --- a/DrissionPage/_units/waiter.pyi +++ b/DrissionPage/_units/waiter.pyi @@ -14,8 +14,8 @@ from .._pages.chromium_base import ChromiumBase from .._pages.chromium_frame import ChromiumFrame from .._pages.chromium_page import ChromiumPage from .._pages.chromium_tab import ChromiumTab -from .._pages.mix_page import MixPage from .._pages.mix_tab import MixTab +from .._pages.web_page import WebPage class OriginWaiter(object): @@ -349,7 +349,7 @@ class MixTabWaiter(BaseWaiter): class ChromiumPageWaiter(TabWaiter): - _owner: Union[ChromiumPage, MixPage] = ... + _owner: Union[ChromiumPage, WebPage] = ... def __init__(self, owner: ChromiumPage): """ @@ -416,10 +416,10 @@ class ChromiumPageWaiter(TabWaiter): ... -class MixPageWaiter(TabWaiter): - _owner: Union[ChromiumPage, MixPage] = ... +class WebPageWaiter(TabWaiter): + _owner: Union[ChromiumPage, WebPage] = ... - def __init__(self, owner: MixPage): + def __init__(self, owner: WebPage): """ :param owner: Page对象 """ @@ -427,7 +427,7 @@ class MixPageWaiter(TabWaiter): def __call__(self, second: float, - scope: float = None) -> MixPage: + scope: float = None) -> WebPage: """等待若干秒,如传入两个参数,等待时间为这两个数间的一个随机数 :param second: 秒数 :param scope: 随机数范围 @@ -459,7 +459,7 @@ class MixPageWaiter(TabWaiter): text: str, exclude: bool = False, timeout: float = None, - raise_err: bool = None) -> Union[False, MixPage]: + raise_err: bool = None) -> Union[False, WebPage]: """等待url变成包含或不包含指定文本 :param text: 用于识别的文本 :param exclude: 是否排除,为True时当url不包含text指定文本时返回True @@ -473,7 +473,7 @@ class MixPageWaiter(TabWaiter): text: str, exclude: bool = False, timeout: float = None, - raise_err: bool = None) -> Union[False, MixPage]: + raise_err: bool = None) -> Union[False, WebPage]: """等待title变成包含或不包含指定文本 :param text: 用于识别的文本 :param exclude: 是否排除,为True时当title不包含text指定文本时返回True diff --git a/DrissionPage/common.py b/DrissionPage/common.py index 96bcb0c..d7f8c38 100644 --- a/DrissionPage/common.py +++ b/DrissionPage/common.py @@ -13,7 +13,6 @@ from ._functions.keys import Keys from ._functions.settings import Settings from ._functions.tools import wait_until, configs_to_here from ._functions.web import get_blob, tree - from ._units.actions import Actions __all__ = ['make_session_ele', 'Actions', 'Keys', 'By', 'Settings', 'wait_until', 'configs_to_here', 'get_blob',