mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
tabs拆分成两个文件;browser文件改名为chromium
This commit is contained in:
parent
987f94104b
commit
1c63a0e36c
@ -5,13 +5,12 @@
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from ._base.browser import Chromium
|
||||
from ._base.chromium import Chromium
|
||||
from ._configs.chromium_options import ChromiumOptions
|
||||
from ._configs.session_options import SessionOptions
|
||||
from ._pages.session_page import SessionPage
|
||||
|
||||
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
|
||||
|
||||
__version__ = '4.1.0.0b20'
|
||||
|
@ -5,14 +5,13 @@
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from ._base.browser import Chromium
|
||||
from ._base.chromium import Chromium
|
||||
from ._configs.chromium_options import ChromiumOptions
|
||||
from ._configs.session_options import SessionOptions
|
||||
from ._pages.session_page import SessionPage
|
||||
|
||||
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
|
||||
|
||||
__all__ = ['MixPage', 'WebPage', 'ChromiumPage', 'Chromium', 'ChromiumOptions', 'SessionOptions', 'SessionPage', '__version__']
|
||||
__version__: str = ...
|
||||
|
@ -21,7 +21,8 @@ from .._functions.settings import Settings
|
||||
from .._functions.tools import PortFinder
|
||||
from .._functions.tools import raise_error
|
||||
from .._pages.chromium_base import Timeout
|
||||
from .._pages.tabs import ChromiumTab, MixTab
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
from .._pages.mix_tab import MixTab
|
||||
from .._units.downloader import DownloadManager
|
||||
from .._units.setter import BrowserSetter
|
||||
from .._units.states import BrowserStates
|
@ -13,7 +13,8 @@ from .._configs.chromium_options import ChromiumOptions
|
||||
from .._configs.session_options import SessionOptions
|
||||
from .._functions.cookies import CookiesList
|
||||
from .._pages.chromium_base import Timeout
|
||||
from .._pages.tabs import ChromiumTab, MixTab
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
from .._pages.mix_tab import MixTab
|
||||
from .._units.downloader import DownloadManager
|
||||
from .._units.setter import BrowserSetter
|
||||
from .._units.states import BrowserStates
|
@ -14,7 +14,7 @@ from .._functions.elements import SessionElementsList, ChromiumElementsList
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.chromium_frame import ChromiumFrame
|
||||
from .._pages.chromium_page import ChromiumPage
|
||||
from .._pages.tabs import ChromiumTab
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
from .._pages.mix_page import MixPage
|
||||
from .._units.clicker import Clicker
|
||||
from .._units.rect import ElementRect
|
||||
|
@ -11,7 +11,7 @@ from typing import Union
|
||||
from requests import Session
|
||||
from requests.cookies import RequestsCookieJar
|
||||
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ from .._base.base import DrissionElement, BaseParser
|
||||
from .._elements.chromium_element import ChromiumElement
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.chromium_page import ChromiumPage
|
||||
from .._pages.tabs import ChromiumTab
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
|
||||
|
||||
def get_ele_txt(e: DrissionElement) -> str:
|
||||
|
@ -9,10 +9,11 @@ from pathlib import Path
|
||||
from typing import Union, Tuple, List, Any, Optional, Literal
|
||||
|
||||
from .chromium_page import ChromiumPage
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .mix_page import MixPage
|
||||
from .tabs import ChromiumTab, MixTab
|
||||
from .mix_tab import MixTab
|
||||
from .._base.base import BasePage
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._base.driver import Driver
|
||||
from .._elements.chromium_element import ChromiumElement
|
||||
from .._elements.session_element import SessionElement
|
||||
|
@ -9,7 +9,8 @@ from pathlib import Path
|
||||
from typing import Union, Tuple, List, Any, Optional, Literal
|
||||
|
||||
from .chromium_base import ChromiumBase
|
||||
from .tabs import ChromiumTab, MixTab
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .mix_tab import MixTab
|
||||
from .._elements.chromium_element import ChromiumElement, ShadowRoot
|
||||
from .._functions.elements import ChromiumElementsList
|
||||
from .._units.listener import FrameListener
|
||||
|
@ -7,7 +7,7 @@
|
||||
"""
|
||||
from time import sleep
|
||||
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._functions.web import save_page
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._units.setter import ChromiumPageSetter
|
||||
|
@ -8,10 +8,10 @@
|
||||
from pathlib import Path
|
||||
from typing import Union, Tuple, List, Optional
|
||||
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._configs.chromium_options import ChromiumOptions
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.tabs import ChromiumTab
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
from .._units.rect import TabRect
|
||||
from .._units.setter import ChromiumPageSetter
|
||||
from .._units.waiter import ChromiumPageWaiter
|
||||
|
70
DrissionPage/_pages/chromium_tab.py
Normal file
70
DrissionPage/_pages/chromium_tab.py
Normal file
@ -0,0 +1,70 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from copy import copy
|
||||
from time import sleep
|
||||
|
||||
from .._functions.settings import Settings
|
||||
from .._functions.web import save_page
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._units.setter import TabSetter
|
||||
from .._units.waiter import TabWaiter
|
||||
|
||||
|
||||
class ChromiumTab(ChromiumBase):
|
||||
_TABS = {}
|
||||
|
||||
def __new__(cls, browser, tab_id):
|
||||
if Settings.singleton_tab_obj and tab_id in cls._TABS:
|
||||
r = cls._TABS[tab_id]
|
||||
while not hasattr(r, '_frame_id'):
|
||||
sleep(.1)
|
||||
return r
|
||||
r = object.__new__(cls)
|
||||
cls._TABS[tab_id] = r
|
||||
return r
|
||||
|
||||
def __init__(self, browser, tab_id):
|
||||
if Settings.singleton_tab_obj and hasattr(self, '_created'):
|
||||
return
|
||||
self._created = True
|
||||
|
||||
super().__init__(browser, tab_id)
|
||||
self._tab = self
|
||||
self._type = 'ChromiumTab'
|
||||
|
||||
def _d_set_runtime_settings(self):
|
||||
self._timeouts = copy(self.browser.timeouts)
|
||||
self.retry_times = self.browser.retry_times
|
||||
self.retry_interval = self.browser.retry_interval
|
||||
self._load_mode = self.browser._load_mode
|
||||
self._download_path = self.browser.download_path
|
||||
self._auto_handle_alert = self.browser._auto_handle_alert
|
||||
|
||||
def close(self, others=False):
|
||||
self.browser.close_tabs(self.tab_id, others=others)
|
||||
|
||||
@property
|
||||
def set(self):
|
||||
if self._set is None:
|
||||
self._set = TabSetter(self)
|
||||
return self._set
|
||||
|
||||
@property
|
||||
def wait(self):
|
||||
if self._wait is None:
|
||||
self._wait = TabWaiter(self)
|
||||
return self._wait
|
||||
|
||||
def save(self, path=None, name=None, as_pdf=False, **kwargs):
|
||||
return save_page(self, path, name, as_pdf, kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f'<ChromiumTab browser_id={self.browser.id} tab_id={self.tab_id}>'
|
||||
|
||||
def _on_disconnect(self):
|
||||
ChromiumTab._TABS.pop(self.tab_id, None)
|
108
DrissionPage/_pages/chromium_tab.pyi
Normal file
108
DrissionPage/_pages/chromium_tab.pyi
Normal file
@ -0,0 +1,108 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from pathlib import Path
|
||||
from typing import Union, Optional
|
||||
|
||||
from .chromium_base import ChromiumBase
|
||||
from .._base.chromium import Chromium
|
||||
from .._units.rect import TabRect
|
||||
from .._units.setter import TabSetter
|
||||
from .._units.waiter import TabWaiter
|
||||
|
||||
|
||||
class ChromiumTab(ChromiumBase):
|
||||
"""实现浏览器标签页的类"""
|
||||
_TABS: dict = ...
|
||||
_tab: ChromiumTab = ...
|
||||
_rect: Optional[TabRect] = ...
|
||||
|
||||
def __new__(cls, browser: Chromium, tab_id: str):
|
||||
"""
|
||||
:param browser: Browser对象
|
||||
:param tab_id: 标签页id
|
||||
"""
|
||||
...
|
||||
|
||||
def __init__(self, browser: Chromium, tab_id: str):
|
||||
"""
|
||||
:param browser: Browser对象
|
||||
:param tab_id: 标签页id
|
||||
"""
|
||||
...
|
||||
|
||||
def _d_set_runtime_settings(self) -> None:
|
||||
"""重写设置浏览器运行参数方法"""
|
||||
...
|
||||
|
||||
def close(self, others: bool = False) -> None:
|
||||
"""关闭标签页
|
||||
:param others: 是否关闭其它,保留自己
|
||||
:return: None
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def set(self) -> TabSetter:
|
||||
"""返回用于设置的对象"""
|
||||
...
|
||||
|
||||
@property
|
||||
def wait(self) -> TabWaiter:
|
||||
"""返回用于等待的对象"""
|
||||
...
|
||||
|
||||
def save(self,
|
||||
path: Union[str, Path] = None,
|
||||
name: str = None,
|
||||
as_pdf: bool = False,
|
||||
landscape: bool = False,
|
||||
displayHeaderFooter: bool = False,
|
||||
printBackground: bool = False,
|
||||
scale: float = 1,
|
||||
paperWidth: float = 8.5,
|
||||
paperHeight: float = 11,
|
||||
marginTop: float = 11,
|
||||
marginBottom: float = 1,
|
||||
marginLeft: float = 1,
|
||||
marginRight: float = 1,
|
||||
pageRanges: str = '',
|
||||
headerTemplate: str = '',
|
||||
footerTemplate: str = '',
|
||||
preferCSSPageSize: bool = False,
|
||||
generateTaggedPDF: bool = ...,
|
||||
generateDocumentOutline: bool = ...) -> Union[bytes, str]:
|
||||
"""把当前页面保存为文件,如果path和name参数都为None,只返回文本
|
||||
:param path: 保存路径,为None且name不为None时保存在当前路径
|
||||
:param name: 文件名,为None且path不为None时用title属性值
|
||||
:param as_pdf: 为Ture保存为pdf,否则为mhtml且忽略kwargs参数
|
||||
:param landscape: 纸张方向,as_pdf为True时才生效
|
||||
:param displayHeaderFooter: 是否显示页头页脚,as_pdf为True时才生效
|
||||
:param printBackground: 是否打印背景图片,as_pdf为True时才生效
|
||||
:param scale: 缩放比例,as_pdf为True时才生效
|
||||
:param paperWidth: 页面宽度(英寸),as_pdf为True时才生效
|
||||
:param paperHeight: 页面高度(英寸),as_pdf为True时才生效
|
||||
:param marginTop: 上边距(英寸),as_pdf为True时才生效
|
||||
:param marginBottom: 下边距(英寸),as_pdf为True时才生效
|
||||
:param marginLeft: 左边距(英寸),as_pdf为True时才生效
|
||||
:param marginRight: 右边距(英寸),as_pdf为True时才生效
|
||||
:param pageRanges: 页面范围,格式'1-5, 8, 11-13',as_pdf为True时才生效
|
||||
:param headerTemplate: 页头HTML模板,as_pdf为True时才生效
|
||||
模板可包含以下class:
|
||||
- date:日期
|
||||
- title:文档标题
|
||||
- url:文档url
|
||||
- pageNumber:当前页码
|
||||
- totalPages:总页数
|
||||
示例:<span class=title></span>
|
||||
:param footerTemplate: 页脚HTML模板,格式与页头的一样,as_pdf为True时才生效
|
||||
:param preferCSSPageSize: 是否使用css定义的页面大小,as_pdf为True时才生效
|
||||
:param generateTaggedPDF: 是否生成带标签的(可访问的)PDF。默认为嵌入器选择,as_pdf为True时才生效
|
||||
:param generateDocumentOutline: 是否将文档大纲嵌入到PDF中。,as_pdf为True时才生效
|
||||
:return: as_pdf为True时返回bytes,否则返回文件文本
|
||||
"""
|
||||
...
|
@ -11,8 +11,8 @@ from requests import Session, Response
|
||||
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_page import ChromiumPage
|
||||
from .mix_tab import MixTab
|
||||
from .session_page import SessionPage
|
||||
from .tabs import MixTab
|
||||
from .._base.base import BasePage
|
||||
from .._configs.chromium_options import ChromiumOptions
|
||||
from .._configs.session_options import SessionOptions
|
||||
|
@ -5,74 +5,14 @@
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from copy import copy
|
||||
from time import sleep
|
||||
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .._base.base import BasePage
|
||||
from .._configs.session_options import SessionOptions
|
||||
from .._functions.cookies import set_session_cookies, set_tab_cookies
|
||||
from .._functions.settings import Settings
|
||||
from .._functions.web import save_page
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.session_page import SessionPage
|
||||
from .._units.setter import TabSetter, MixTabSetter
|
||||
from .._units.waiter import TabWaiter
|
||||
|
||||
|
||||
class ChromiumTab(ChromiumBase):
|
||||
"""实现浏览器标签页的类"""
|
||||
_TABS = {}
|
||||
|
||||
def __new__(cls, browser, tab_id):
|
||||
if Settings.singleton_tab_obj and tab_id in cls._TABS:
|
||||
r = cls._TABS[tab_id]
|
||||
while not hasattr(r, '_frame_id'):
|
||||
sleep(.1)
|
||||
return r
|
||||
r = object.__new__(cls)
|
||||
cls._TABS[tab_id] = r
|
||||
return r
|
||||
|
||||
def __init__(self, browser, tab_id):
|
||||
if Settings.singleton_tab_obj and hasattr(self, '_created'):
|
||||
return
|
||||
self._created = True
|
||||
|
||||
super().__init__(browser, tab_id)
|
||||
self._tab = self
|
||||
self._type = 'ChromiumTab'
|
||||
|
||||
def _d_set_runtime_settings(self):
|
||||
self._timeouts = copy(self.browser.timeouts)
|
||||
self.retry_times = self.browser.retry_times
|
||||
self.retry_interval = self.browser.retry_interval
|
||||
self._load_mode = self.browser._load_mode
|
||||
self._download_path = self.browser.download_path
|
||||
self._auto_handle_alert = self.browser._auto_handle_alert
|
||||
|
||||
def close(self, others=False):
|
||||
self.browser.close_tabs(self.tab_id, others=others)
|
||||
|
||||
@property
|
||||
def set(self):
|
||||
if self._set is None:
|
||||
self._set = TabSetter(self)
|
||||
return self._set
|
||||
|
||||
@property
|
||||
def wait(self):
|
||||
if self._wait is None:
|
||||
self._wait = TabWaiter(self)
|
||||
return self._wait
|
||||
|
||||
def save(self, path=None, name=None, as_pdf=False, **kwargs):
|
||||
return save_page(self, path, name, as_pdf, kwargs)
|
||||
|
||||
def __repr__(self):
|
||||
return f'<ChromiumTab browser_id={self.browser.id} tab_id={self.tab_id}>'
|
||||
|
||||
def _on_disconnect(self):
|
||||
ChromiumTab._TABS.pop(self.tab_id, None)
|
||||
from .._units.setter import MixTabSetter
|
||||
|
||||
|
||||
class MixTab(SessionPage, ChromiumTab, BasePage):
|
@ -5,114 +5,20 @@
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from pathlib import Path
|
||||
from typing import Union, Tuple, Any, Optional, Literal
|
||||
|
||||
from requests import Session, Response
|
||||
|
||||
from .chromium_base import ChromiumBase
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .session_page import SessionPage
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._elements.chromium_element import ChromiumElement
|
||||
from .._elements.session_element import SessionElement
|
||||
from .._functions.cookies import CookiesList
|
||||
from .._functions.elements import SessionElementsList, ChromiumElementsList
|
||||
from .._units.rect import TabRect
|
||||
from .._units.setter import TabSetter, MixTabSetter
|
||||
from .._units.waiter import TabWaiter, MixTabWaiter
|
||||
|
||||
|
||||
class ChromiumTab(ChromiumBase):
|
||||
_TABS: dict = ...
|
||||
_tab: ChromiumTab = ...
|
||||
_rect: Optional[TabRect] = ...
|
||||
|
||||
def __new__(cls, browser: Chromium, tab_id: str):
|
||||
"""
|
||||
:param browser: Browser对象
|
||||
:param tab_id: 标签页id
|
||||
"""
|
||||
...
|
||||
|
||||
def __init__(self, browser: Chromium, tab_id: str):
|
||||
"""
|
||||
:param browser: Browser对象
|
||||
:param tab_id: 标签页id
|
||||
"""
|
||||
...
|
||||
|
||||
def _d_set_runtime_settings(self) -> None:
|
||||
"""重写设置浏览器运行参数方法"""
|
||||
...
|
||||
|
||||
def close(self, others: bool = False) -> None:
|
||||
"""关闭标签页
|
||||
:param others: 是否关闭其它,保留自己
|
||||
:return: None
|
||||
"""
|
||||
...
|
||||
|
||||
@property
|
||||
def set(self) -> TabSetter:
|
||||
"""返回用于设置的对象"""
|
||||
...
|
||||
|
||||
@property
|
||||
def wait(self) -> TabWaiter:
|
||||
"""返回用于等待的对象"""
|
||||
...
|
||||
|
||||
def save(self,
|
||||
path: Union[str, Path] = None,
|
||||
name: str = None,
|
||||
as_pdf: bool = False,
|
||||
landscape: bool = False,
|
||||
displayHeaderFooter: bool = False,
|
||||
printBackground: bool = False,
|
||||
scale: float = 1,
|
||||
paperWidth: float = 8.5,
|
||||
paperHeight: float = 11,
|
||||
marginTop: float = 11,
|
||||
marginBottom: float = 1,
|
||||
marginLeft: float = 1,
|
||||
marginRight: float = 1,
|
||||
pageRanges: str = '',
|
||||
headerTemplate: str = '',
|
||||
footerTemplate: str = '',
|
||||
preferCSSPageSize: bool = False,
|
||||
generateTaggedPDF: bool = ...,
|
||||
generateDocumentOutline: bool = ...) -> Union[bytes, str]:
|
||||
"""把当前页面保存为文件,如果path和name参数都为None,只返回文本
|
||||
:param path: 保存路径,为None且name不为None时保存在当前路径
|
||||
:param name: 文件名,为None且path不为None时用title属性值
|
||||
:param as_pdf: 为Ture保存为pdf,否则为mhtml且忽略kwargs参数
|
||||
:param landscape: 纸张方向,as_pdf为True时才生效
|
||||
:param displayHeaderFooter: 是否显示页头页脚,as_pdf为True时才生效
|
||||
:param printBackground: 是否打印背景图片,as_pdf为True时才生效
|
||||
:param scale: 缩放比例,as_pdf为True时才生效
|
||||
:param paperWidth: 页面宽度(英寸),as_pdf为True时才生效
|
||||
:param paperHeight: 页面高度(英寸),as_pdf为True时才生效
|
||||
:param marginTop: 上边距(英寸),as_pdf为True时才生效
|
||||
:param marginBottom: 下边距(英寸),as_pdf为True时才生效
|
||||
:param marginLeft: 左边距(英寸),as_pdf为True时才生效
|
||||
:param marginRight: 右边距(英寸),as_pdf为True时才生效
|
||||
:param pageRanges: 页面范围,格式'1-5, 8, 11-13',as_pdf为True时才生效
|
||||
:param headerTemplate: 页头HTML模板,as_pdf为True时才生效
|
||||
模板可包含以下class:
|
||||
- date:日期
|
||||
- title:文档标题
|
||||
- url:文档url
|
||||
- pageNumber:当前页码
|
||||
- totalPages:总页数
|
||||
示例:<span class=title></span>
|
||||
:param footerTemplate: 页脚HTML模板,格式与页头的一样,as_pdf为True时才生效
|
||||
:param preferCSSPageSize: 是否使用css定义的页面大小,as_pdf为True时才生效
|
||||
:param generateTaggedPDF: 是否生成带标签的(可访问的)PDF。默认为嵌入器选择,as_pdf为True时才生效
|
||||
:param generateDocumentOutline: 是否将文档大纲嵌入到PDF中。,as_pdf为True时才生效
|
||||
:return: as_pdf为True时返回bytes,否则返回文件文本
|
||||
"""
|
||||
...
|
||||
from .._units.setter import MixTabSetter
|
||||
from .._units.waiter import MixTabWaiter
|
||||
|
||||
|
||||
class MixTab(SessionPage, ChromiumTab):
|
@ -204,7 +204,7 @@ class Actions:
|
||||
|
||||
def key_down(self, key: Union[KEYS, str]) -> Actions:
|
||||
"""按下键盘上的按键,
|
||||
:param key: 使用Keys获取的按键,或'DEL'形式按键名称
|
||||
:param key: 使用Keys获取的按键,或 'DEL' 形式按键名称
|
||||
:return: self
|
||||
"""
|
||||
...
|
||||
|
@ -10,7 +10,8 @@ from typing import Union
|
||||
|
||||
from .downloader import DownloadMission
|
||||
from .._elements.chromium_element import ChromiumElement
|
||||
from .._pages.tabs import MixTab, ChromiumTab
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
from .._pages.mix_tab import MixTab
|
||||
|
||||
|
||||
class Clicker(object):
|
||||
|
@ -8,11 +8,11 @@
|
||||
from http.cookiejar import Cookie, CookieJar
|
||||
from typing import Union
|
||||
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.tabs import MixTab
|
||||
from .._pages.session_page import SessionPage
|
||||
from .._pages.mix_page import MixPage
|
||||
from .._pages.mix_tab import MixTab
|
||||
from .._pages.session_page import SessionPage
|
||||
|
||||
|
||||
class BrowserCookiesSetter(object):
|
||||
|
@ -7,7 +7,7 @@
|
||||
"""
|
||||
from typing import Dict, Optional, Union, Literal
|
||||
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
|
||||
FILE_EXISTS = Literal['skip', 'rename', 'overwrite', 's', 'r', 'o']
|
||||
|
@ -5,15 +5,15 @@
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
|
||||
from typing import Tuple, Union
|
||||
|
||||
from .._elements.chromium_element import ChromiumElement
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.chromium_frame import ChromiumFrame
|
||||
from .._pages.chromium_page import ChromiumPage
|
||||
from .._pages.tabs import ChromiumTab, MixTab
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
from .._pages.mix_page import MixPage
|
||||
from .._pages.mix_tab import MixTab
|
||||
|
||||
|
||||
class ElementRect(object):
|
||||
|
@ -11,8 +11,9 @@ from .._elements.chromium_element import ChromiumElement
|
||||
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.tabs import ChromiumTab, MixTab
|
||||
from .._pages.mix_tab import MixTab
|
||||
|
||||
|
||||
class Scroller(object):
|
||||
|
@ -14,14 +14,15 @@ from requests.auth import HTTPBasicAuth
|
||||
from .cookies_setter import SessionCookiesSetter, CookiesSetter, MixPageCookiesSetter, BrowserCookiesSetter
|
||||
from .scroller import PageScroller
|
||||
from .._base.base import BasePage
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._elements.chromium_element import ChromiumElement
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.chromium_frame import ChromiumFrame
|
||||
from .._pages.chromium_page import ChromiumPage
|
||||
from .._pages.tabs import ChromiumTab, MixTab
|
||||
from .._pages.session_page import SessionPage
|
||||
from .._pages.chromium_tab import ChromiumTab
|
||||
from .._pages.mix_page import MixPage
|
||||
from .._pages.mix_tab import MixTab
|
||||
from .._pages.session_page import SessionPage
|
||||
|
||||
FILE_EXISTS = Literal['skip', 'rename', 'overwrite', 's', 'r', 'o']
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
"""
|
||||
from typing import Union, Tuple, List, Optional, Literal
|
||||
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._elements.chromium_element import ShadowRoot, ChromiumElement
|
||||
from .._pages.chromium_base import ChromiumBase
|
||||
from .._pages.chromium_frame import ChromiumFrame
|
||||
|
@ -8,13 +8,14 @@
|
||||
from typing import Union, Tuple, List, Any
|
||||
|
||||
from .downloader import DownloadMission
|
||||
from .._base.browser import Chromium
|
||||
from .._base.chromium import Chromium
|
||||
from .._elements.chromium_element import ChromiumElement
|
||||
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.tabs import ChromiumTab, MixTab
|
||||
from .._pages.mix_tab import MixTab
|
||||
|
||||
|
||||
class OriginWaiter(object):
|
||||
|
@ -5,7 +5,7 @@
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from ._base.browser import Chromium
|
||||
from ._base.chromium import Chromium
|
||||
from ._elements.session_element import make_session_ele
|
||||
from ._functions.by import By
|
||||
from ._functions.elements import get_eles
|
||||
|
@ -9,8 +9,9 @@ from ._elements.chromium_element import ChromiumElement, ShadowRoot
|
||||
from ._elements.none_element import NoneElement
|
||||
from ._elements.session_element import SessionElement
|
||||
from ._pages.chromium_frame import ChromiumFrame
|
||||
from ._pages.tabs import ChromiumTab, MixTab
|
||||
from ._pages.tabs import MixTab as WebPageTab
|
||||
from ._pages.chromium_tab import ChromiumTab
|
||||
from ._pages.mix_tab import MixTab
|
||||
from ._pages.mix_tab import MixTab as WebPageTab
|
||||
|
||||
__all__ = ['ChromiumElement', 'ShadowRoot', 'NoneElement', 'SessionElement', 'ChromiumFrame', 'ChromiumTab',
|
||||
'MixTab', 'WebPageTab']
|
||||
|
@ -1,34 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta content="code-wXFsIBcC45" name="baidu-site-verification"/>
|
||||
<title>DrissionPage</title>
|
||||
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
|
||||
<meta content="Description" name="description">
|
||||
<meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0" name="viewport">
|
||||
<meta content="DrissionPage,文档,使用文档,教程,用户手册,api" name="Keywords">
|
||||
<!-- <link href="//cdn.jsdelivr.net/npm/docsify@4/lib/themes/vue.css" rel="stylesheet">-->
|
||||
|
||||
<!-- Theme: Simple Dark -->
|
||||
<!-- <link href="scripts/theme-simple-dark.css" rel="stylesheet">-->
|
||||
|
||||
<!--
|
||||
<link href="//unpkg.com/gitalk/dist/gitalk.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="./ignore/font.css">
|
||||
-->
|
||||
<!-- <style>
|
||||
/* body {font-family: PingFang; } */
|
||||
</style> -->
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app"><a href="http://g1879.gitee.io/drissionpagedocs">DrissionPage文档</a></div>
|
||||
<script>
|
||||
window.location.replace("http://g1879.gitee.io/drissionpagedocs");
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user