mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
调整项目文件目录
This commit is contained in:
parent
19f99b4d62
commit
aafbc7a839
@ -4,10 +4,10 @@
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
# 常用页面类
|
||||
from .chromium_page import ChromiumPage
|
||||
from .session_page import SessionPage
|
||||
from .web_page import WebPage
|
||||
from ._pages.chromium_page import ChromiumPage
|
||||
from ._pages.session_page import SessionPage
|
||||
from ._pages.web_page import WebPage
|
||||
|
||||
# 启动配置类
|
||||
from .configs.chromium_options import ChromiumOptions
|
||||
from .configs.session_options import SessionOptions
|
||||
from ._configs.chromium_options import ChromiumOptions
|
||||
from ._configs.session_options import SessionOptions
|
||||
|
@ -10,10 +10,10 @@ from urllib.parse import quote
|
||||
|
||||
from DownloadKit import DownloadKit
|
||||
|
||||
from .commons.constants import Settings, NoneElement
|
||||
from .commons.locator import get_loc
|
||||
from .commons.web import format_html
|
||||
from .errors import ElementNotFoundError
|
||||
from DrissionPage._commons.constants import Settings, NoneElement
|
||||
from DrissionPage._commons.locator import get_loc
|
||||
from DrissionPage._commons.web import format_html
|
||||
from DrissionPage.errors import ElementNotFoundError
|
||||
|
||||
|
||||
class BaseParser(object):
|
||||
@ -367,7 +367,7 @@ class BasePage(BaseParser):
|
||||
self.retry_times = 3
|
||||
self.retry_interval = 2
|
||||
self._DownloadKit = None
|
||||
self._download_path = str(Path('.').absolute())
|
||||
self._download_path = str(Path('../..').absolute())
|
||||
|
||||
@property
|
||||
def title(self):
|
@ -8,7 +8,7 @@ from typing import Union, Tuple, List
|
||||
|
||||
from DownloadKit import DownloadKit
|
||||
|
||||
from .commons.constants import NoneElement
|
||||
from DrissionPage._commons.constants import NoneElement
|
||||
|
||||
|
||||
class BaseParser(object):
|
@ -1,7 +1,11 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from time import sleep
|
||||
|
||||
from .browser_download_manager import BrowserDownloadManager
|
||||
from DrissionPage._units.browser_download_manager import BrowserDownloadManager
|
||||
from .chromium_driver import BrowserDriver
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from typing import List, Optional, Union
|
||||
|
||||
from .browser_download_manager import BrowserDownloadManager
|
||||
from .chromium_page import ChromiumPage
|
||||
from DrissionPage._units.browser_download_manager import BrowserDownloadManager
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from .chromium_driver import BrowserDriver
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from DrissionPage.configs.chromium_options import ChromiumOptions
|
||||
from DrissionPage._configs.chromium_options import ChromiumOptions
|
||||
|
||||
|
||||
def connect_browser(option: ChromiumOptions) -> tuple: ...
|
@ -1,6 +1,11 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from click import command, option
|
||||
|
||||
from DrissionPage import ChromiumPage
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from DrissionPage.easy_set import set_paths, configs_to_here as ch
|
||||
|
||||
|
@ -8,7 +8,7 @@ from pathlib import Path
|
||||
from typing import Union
|
||||
from types import FunctionType
|
||||
|
||||
from chromium_page import ChromiumPage
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
|
||||
|
||||
def get_usable_path(path: Union[str, Path], is_file: bool = True, parents: bool = True) -> Path: ...
|
@ -10,8 +10,8 @@ from requests import Session
|
||||
from requests.cookies import RequestsCookieJar
|
||||
|
||||
from DrissionPage.base import DrissionElement, BasePage
|
||||
from DrissionPage.chromium_element import ChromiumElement
|
||||
from DrissionPage.chromium_base import ChromiumBase
|
||||
from DrissionPage._chromium_element import ChromiumElement
|
||||
from DrissionPage._chromium_base import ChromiumBase
|
||||
|
||||
|
||||
def get_ele_txt(e: DrissionElement) -> str: ...
|
@ -6,7 +6,7 @@
|
||||
from pathlib import Path
|
||||
from tempfile import gettempdir, TemporaryDirectory
|
||||
|
||||
from DrissionPage.commons.tools import port_is_using, clean_folder
|
||||
from DrissionPage._commons.tools import port_is_using, clean_folder
|
||||
from .options_manage import OptionsManager
|
||||
|
||||
|
@ -8,7 +8,7 @@ from pathlib import Path
|
||||
from requests import Session
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
from DrissionPage.commons.web import cookies_to_tuple, set_session_cookies
|
||||
from DrissionPage._commons.web import cookies_to_tuple, set_session_cookies
|
||||
from .options_manage import OptionsManager
|
||||
|
||||
|
@ -7,17 +7,17 @@ from os.path import basename, sep
|
||||
from pathlib import Path
|
||||
from time import perf_counter, sleep
|
||||
|
||||
from .base import DrissionElement, BaseElement
|
||||
from .commons.constants import FRAME_ELEMENT, NoneElement, Settings
|
||||
from .commons.keys import keys_to_typing, keyDescriptionForString, keyDefinitions
|
||||
from .commons.locator import get_loc
|
||||
from .commons.tools import get_usable_path
|
||||
from .commons.web import make_absolute_link, get_ele_txt, format_html, is_js_func, location_in_viewport, offset_scroll
|
||||
from .errors import ContextLossError, ElementLossError, JavaScriptError, NoRectError, ElementNotFoundError, \
|
||||
from DrissionPage._base.base import DrissionElement, BaseElement
|
||||
from DrissionPage._commons.constants import FRAME_ELEMENT, NoneElement, Settings
|
||||
from DrissionPage._commons.keys import keys_to_typing, keyDescriptionForString, keyDefinitions
|
||||
from DrissionPage._commons.locator import get_loc
|
||||
from DrissionPage._commons.tools import get_usable_path
|
||||
from DrissionPage._commons.web import make_absolute_link, get_ele_txt, format_html, is_js_func, location_in_viewport, offset_scroll
|
||||
from DrissionPage.errors import ContextLossError, ElementLossError, JavaScriptError, NoRectError, ElementNotFoundError, \
|
||||
CDPError, NoResourceError, CanNotClickError
|
||||
from .session_element import make_session_ele
|
||||
from .setter import ChromiumElementSetter
|
||||
from .waiter import ChromiumElementWaiter
|
||||
from DrissionPage._units.setter import ChromiumElementSetter
|
||||
from DrissionPage._units.waiter import ChromiumElementWaiter
|
||||
|
||||
|
||||
class ChromiumElement(DrissionElement):
|
||||
@ -1203,7 +1203,7 @@ def make_chromium_ele(page, node_id=None, obj_id=None):
|
||||
|
||||
ele = ChromiumElement(page, obj_id=obj_id, node_id=node_id, backend_id=backend_id)
|
||||
if ele.tag in FRAME_ELEMENT:
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from ._chromium_frame import ChromiumFrame
|
||||
ele = ChromiumFrame(page, ele)
|
||||
|
||||
return ele
|
@ -6,15 +6,15 @@
|
||||
from pathlib import Path
|
||||
from typing import Union, Tuple, List, Any
|
||||
|
||||
from .base import DrissionElement, BaseElement
|
||||
from .chromium_base import ChromiumBase
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_page import ChromiumPage
|
||||
from .commons.constants import NoneElement
|
||||
from .session_element import SessionElement
|
||||
from .setter import ChromiumElementSetter
|
||||
from .waiter import ChromiumElementWaiter
|
||||
from .web_page import WebPage
|
||||
from DrissionPage._base.base import DrissionElement, BaseElement
|
||||
from DrissionPage._commons.constants import NoneElement
|
||||
from DrissionPage._elements.session_element import SessionElement
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from DrissionPage._pages.web_page import WebPage
|
||||
from DrissionPage._units.setter import ChromiumElementSetter
|
||||
from DrissionPage._units.waiter import ChromiumElementWaiter
|
||||
|
||||
|
||||
class ChromiumElement(DrissionElement):
|
@ -9,10 +9,10 @@ from re import match, DOTALL
|
||||
from lxml.etree import tostring
|
||||
from lxml.html import HtmlElement, fromstring
|
||||
|
||||
from .base import DrissionElement, BasePage, BaseElement
|
||||
from .commons.constants import NoneElement
|
||||
from .commons.locator import get_loc
|
||||
from .commons.web import get_ele_txt, make_absolute_link
|
||||
from DrissionPage._base.base import DrissionElement, BasePage, BaseElement
|
||||
from DrissionPage._commons.constants import NoneElement
|
||||
from DrissionPage._commons.locator import get_loc
|
||||
from DrissionPage._commons.web import get_ele_txt, make_absolute_link
|
||||
|
||||
|
||||
class SessionElement(DrissionElement):
|
@ -7,12 +7,12 @@ from typing import Union, List, Tuple
|
||||
|
||||
from lxml.html import HtmlElement
|
||||
|
||||
from .base import DrissionElement, BaseElement
|
||||
from .chromium_base import ChromiumBase
|
||||
from .chromium_element import ChromiumElement
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .commons.constants import NoneElement
|
||||
from .session_page import SessionPage
|
||||
from DrissionPage._base.base import DrissionElement, BaseElement
|
||||
from DrissionPage._commons.constants import NoneElement
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
||||
from DrissionPage._pages.session_page import SessionPage
|
||||
|
||||
|
||||
class SessionElement(DrissionElement):
|
@ -13,20 +13,20 @@ from time import perf_counter, sleep, time
|
||||
|
||||
from requests import get
|
||||
|
||||
from .action_chains import ActionChains
|
||||
from .base import BasePage
|
||||
from .chromium_driver import ChromiumDriver
|
||||
from .chromium_element import ChromiumScroll, ChromiumElement, run_js, make_chromium_ele
|
||||
from .commons.constants import HANDLE_ALERT_METHOD, ERROR, NoneElement
|
||||
from .commons.locator import get_loc
|
||||
from .commons.tools import get_usable_path, clean_folder
|
||||
from .commons.web import location_in_viewport
|
||||
from .errors import ContextLossError, ElementLossError, AlertExistsError, CDPError, TabClosedError, \
|
||||
from DrissionPage._base.base import BasePage
|
||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
||||
from DrissionPage._commons.constants import HANDLE_ALERT_METHOD, ERROR, NoneElement
|
||||
from DrissionPage._commons.locator import get_loc
|
||||
from DrissionPage._commons.tools import get_usable_path, clean_folder
|
||||
from DrissionPage._commons.web import location_in_viewport
|
||||
from DrissionPage._elements.chromium_element import ChromiumScroll, ChromiumElement, run_js, make_chromium_ele
|
||||
from DrissionPage._elements.session_element import make_session_ele
|
||||
from DrissionPage._units.network_listener import NetworkListener
|
||||
from DrissionPage._units.setter import ChromiumBaseSetter
|
||||
from DrissionPage._units.waiter import ChromiumBaseWaiter
|
||||
from DrissionPage.errors import ContextLossError, ElementLossError, AlertExistsError, CDPError, TabClosedError, \
|
||||
NoRectError, BrowserConnectError, GetDocumentError
|
||||
from .network_listener import NetworkListener
|
||||
from .session_element import make_session_ele
|
||||
from .setter import ChromiumBaseSetter
|
||||
from .waiter import ChromiumBaseWaiter
|
||||
from _units.action_chains import ActionChains
|
||||
|
||||
|
||||
class ChromiumBase(BasePage):
|
||||
@ -48,7 +48,7 @@ class ChromiumBase(BasePage):
|
||||
self._actions = None
|
||||
self._listener = None
|
||||
|
||||
self._download_path = str(Path('.').absolute())
|
||||
self._download_path = str(Path('../..').absolute())
|
||||
|
||||
if isinstance(address, int) or (isinstance(address, str) and address.isdigit()):
|
||||
address = f'127.0.0.1:{address}'
|
@ -8,18 +8,18 @@ from typing import Union, Tuple, List, Any
|
||||
|
||||
from DataRecorder import Recorder
|
||||
|
||||
from .browser import Browser
|
||||
from .action_chains import ActionChains
|
||||
from .base import BasePage
|
||||
from .chromium_driver import ChromiumDriver
|
||||
from .chromium_element import ChromiumElement, ChromiumScroll
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_page import ChromiumPage
|
||||
from .commons.constants import NoneElement
|
||||
from .network_listener import NetworkListener
|
||||
from .session_element import SessionElement
|
||||
from .setter import ChromiumBaseSetter
|
||||
from .waiter import ChromiumBaseWaiter
|
||||
from DrissionPage._base.base import BasePage
|
||||
from DrissionPage._base.browser import Browser
|
||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
||||
from DrissionPage._commons.constants import NoneElement
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement, ChromiumScroll
|
||||
from DrissionPage._elements.session_element import SessionElement
|
||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from DrissionPage._units.action_chains import ActionChains
|
||||
from DrissionPage._units.network_listener import NetworkListener
|
||||
from DrissionPage._units.setter import ChromiumBaseSetter
|
||||
from DrissionPage._units.waiter import ChromiumBaseWaiter
|
||||
|
||||
|
||||
class ChromiumBase(BasePage):
|
@ -10,11 +10,11 @@ from time import sleep, perf_counter
|
||||
|
||||
from requests import get
|
||||
|
||||
from .chromium_base import ChromiumBase, ChromiumPageScroll
|
||||
from .chromium_element import ChromiumElement
|
||||
from .errors import ContextLossError
|
||||
from .setter import ChromiumFrameSetter
|
||||
from .waiter import FrameWaiter
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
||||
from DrissionPage._units.setter import ChromiumFrameSetter
|
||||
from DrissionPage._units.waiter import FrameWaiter
|
||||
from DrissionPage.errors import ContextLossError
|
||||
|
||||
|
||||
class ChromiumFrame(ChromiumBase):
|
@ -6,12 +6,13 @@
|
||||
from pathlib import Path
|
||||
from typing import Union, Tuple, List, Any
|
||||
|
||||
from DrissionPage import ChromiumPage, WebPage
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .chromium_base import ChromiumBase, ChromiumPageScroll
|
||||
from .chromium_element import ChromiumElement, Locations, ChromiumElementStates
|
||||
from .setter import ChromiumFrameSetter
|
||||
from .waiter import FrameWaiter
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement, Locations, ChromiumElementStates
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
||||
from DrissionPage._pages.web_page import WebPage
|
||||
from DrissionPage._units.setter import ChromiumFrameSetter
|
||||
from DrissionPage._units.waiter import FrameWaiter
|
||||
|
||||
|
||||
class ChromiumFrame(ChromiumBase):
|
@ -8,14 +8,14 @@ from time import perf_counter, sleep
|
||||
|
||||
from requests import get
|
||||
|
||||
from .browser import Browser
|
||||
from .chromium_base import ChromiumBase, Timeout
|
||||
from .chromium_driver import ChromiumDriver
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .commons.browser import connect_browser
|
||||
from .configs.chromium_options import ChromiumOptions
|
||||
from .setter import ChromiumPageSetter
|
||||
from .waiter import ChromiumPageWaiter
|
||||
from DrissionPage._base.browser import Browser
|
||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
||||
from DrissionPage._commons.browser import connect_browser
|
||||
from DrissionPage._configs.chromium_options import ChromiumOptions
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase, Timeout
|
||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
||||
from DrissionPage._units.setter import ChromiumPageSetter
|
||||
from DrissionPage._units.waiter import ChromiumPageWaiter
|
||||
|
||||
|
||||
class ChromiumPage(ChromiumBase):
|
@ -5,13 +5,13 @@
|
||||
"""
|
||||
from typing import Union, Tuple, List, Optional
|
||||
|
||||
from .browser import Browser
|
||||
from .chromium_base import ChromiumBase
|
||||
from .chromium_driver import ChromiumDriver
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .configs.chromium_options import ChromiumOptions
|
||||
from .setter import ChromiumPageSetter
|
||||
from .waiter import ChromiumPageWaiter
|
||||
from DrissionPage._base.browser import Browser
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
||||
from DrissionPage._configs.chromium_options import ChromiumOptions
|
||||
from DrissionPage._units.setter import ChromiumPageSetter
|
||||
from DrissionPage._units.waiter import ChromiumPageWaiter
|
||||
|
||||
|
||||
class ChromiumPage(ChromiumBase):
|
@ -5,13 +5,12 @@
|
||||
"""
|
||||
from copy import copy
|
||||
|
||||
from .base import BasePage
|
||||
from .chromium_base import ChromiumBase
|
||||
from .commons.web import set_session_cookies, set_browser_cookies
|
||||
from .session_page import SessionPage
|
||||
from .setter import TabSetter
|
||||
from .setter import WebPageTabSetter
|
||||
from .waiter import ChromiumTabWaiter
|
||||
from DrissionPage._base.base import BasePage
|
||||
from DrissionPage._commons.web import set_session_cookies, set_browser_cookies
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
from DrissionPage._pages.session_page import SessionPage
|
||||
from DrissionPage._units.setter import TabSetter, WebPageTabSetter
|
||||
from DrissionPage._units.waiter import ChromiumTabWaiter
|
||||
|
||||
|
||||
class ChromiumTab(ChromiumBase):
|
@ -7,17 +7,16 @@ from typing import Union, Tuple, Any, List
|
||||
|
||||
from requests import Session, Response
|
||||
|
||||
from .browser import Browser
|
||||
from .chromium_base import ChromiumBase
|
||||
from .chromium_element import ChromiumElement
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_page import ChromiumPage, ChromiumTabRect
|
||||
from .session_element import SessionElement
|
||||
from .session_page import SessionPage
|
||||
from .setter import TabSetter
|
||||
from .setter import WebPageTabSetter
|
||||
from .waiter import ChromiumTabWaiter
|
||||
from .web_page import WebPage
|
||||
from DrissionPage._base.browser import Browser
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
||||
from DrissionPage._elements.session_element import SessionElement
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage, ChromiumTabRect
|
||||
from DrissionPage._pages.session_page import SessionPage
|
||||
from DrissionPage._pages.web_page import WebPage
|
||||
from DrissionPage._units.setter import TabSetter, WebPageTabSetter
|
||||
from DrissionPage._units.waiter import ChromiumTabWaiter
|
||||
|
||||
|
||||
class ChromiumTab(ChromiumBase):
|
@ -11,11 +11,11 @@ from requests import Session
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
from tldextract import extract
|
||||
|
||||
from .base import BasePage
|
||||
from .commons.web import cookie_to_dict
|
||||
from .configs.session_options import SessionOptions
|
||||
from .session_element import SessionElement, make_session_ele
|
||||
from .setter import SessionPageSetter
|
||||
from DrissionPage._base.base import BasePage
|
||||
from DrissionPage._commons.web import cookie_to_dict
|
||||
from DrissionPage._configs.session_options import SessionOptions
|
||||
from DrissionPage._elements.session_element import SessionElement, make_session_ele
|
||||
from DrissionPage._units.setter import SessionPageSetter
|
||||
|
||||
|
||||
class SessionPage(BasePage):
|
@ -8,11 +8,11 @@ from typing import Any, Union, Tuple, List
|
||||
from requests import Session, Response
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
from .base import BasePage
|
||||
from .commons.constants import NoneElement
|
||||
from .configs.session_options import SessionOptions
|
||||
from .session_element import SessionElement
|
||||
from .setter import SessionPageSetter
|
||||
from DrissionPage._base.base import BasePage
|
||||
from DrissionPage._commons.constants import NoneElement
|
||||
from DrissionPage._configs.session_options import SessionOptions
|
||||
from DrissionPage._elements.session_element import SessionElement
|
||||
from DrissionPage._units.setter import SessionPageSetter
|
||||
|
||||
|
||||
class SessionPage(BasePage):
|
@ -3,13 +3,13 @@
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from .base import BasePage
|
||||
from .chromium_page import ChromiumPage
|
||||
from .chromium_tab import WebPageTab
|
||||
from .commons.web import set_session_cookies, set_browser_cookies
|
||||
from .configs.chromium_options import ChromiumOptions
|
||||
from DrissionPage._base.base import BasePage
|
||||
from DrissionPage._commons.web import set_session_cookies, set_browser_cookies
|
||||
from DrissionPage._configs.chromium_options import ChromiumOptions
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from DrissionPage._pages.chromium_tab import WebPageTab
|
||||
from DrissionPage._units.setter import WebPageSetter
|
||||
from .session_page import SessionPage
|
||||
from .setter import WebPageSetter
|
||||
|
||||
|
||||
class WebPage(SessionPage, ChromiumPage, BasePage):
|
@ -5,20 +5,19 @@
|
||||
"""
|
||||
from typing import Union, Tuple, List, Any
|
||||
|
||||
from DownloadKit import DownloadKit
|
||||
from requests import Session, Response
|
||||
|
||||
from .base import BasePage
|
||||
from .chromium_driver import ChromiumDriver
|
||||
from .chromium_element import ChromiumElement
|
||||
from ._base import BasePage
|
||||
from ._chromium_driver import ChromiumDriver
|
||||
from ._chromium_element import ChromiumElement
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_page import ChromiumPage
|
||||
from .chromium_tab import WebPageTab
|
||||
from .configs.chromium_options import ChromiumOptions
|
||||
from .configs.session_options import SessionOptions
|
||||
from .session_element import SessionElement
|
||||
from ._configs.chromium_options import ChromiumOptions
|
||||
from ._configs.session_options import SessionOptions
|
||||
from ._session_element import SessionElement
|
||||
from .session_page import SessionPage
|
||||
from .setter import WebPageSetter
|
||||
from ._units.setter import WebPageSetter
|
||||
|
||||
|
||||
class WebPage(SessionPage, ChromiumPage, BasePage):
|
@ -5,8 +5,8 @@
|
||||
"""
|
||||
from time import sleep
|
||||
|
||||
from .commons.keys import modifierBit, keyDescriptionForString
|
||||
from .commons.web import location_in_viewport
|
||||
from DrissionPage._commons.keys import modifierBit, keyDescriptionForString
|
||||
from DrissionPage._commons.web import location_in_viewport
|
||||
|
||||
|
||||
class ActionChains:
|
@ -5,10 +5,9 @@
|
||||
"""
|
||||
from typing import Union, Tuple
|
||||
|
||||
from .chromium_base import ChromiumBase
|
||||
from .chromium_driver import ChromiumDriver
|
||||
from .chromium_element import ChromiumElement
|
||||
from .chromium_page import ChromiumPage
|
||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
|
||||
|
||||
class ActionChains:
|
@ -4,7 +4,7 @@ from pathlib import Path
|
||||
from shutil import move
|
||||
from time import sleep, perf_counter
|
||||
|
||||
from .commons.tools import get_usable_path
|
||||
from DrissionPage._commons.tools import get_usable_path
|
||||
|
||||
|
||||
class BrowserDownloadManager(object):
|
@ -1,8 +1,8 @@
|
||||
from pathlib import Path
|
||||
from typing import Dict, Optional, Union
|
||||
|
||||
from .browser import Browser
|
||||
from .chromium_page import ChromiumPage
|
||||
from DrissionPage._base.browser import Browser
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
|
||||
|
||||
class BrowserDownloadManager(object):
|
@ -1,4 +1,8 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from base64 import b64decode
|
||||
from json import JSONDecodeError, loads
|
||||
from queue import Queue
|
||||
@ -8,7 +12,7 @@ from time import perf_counter, sleep
|
||||
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
from .errors import CDPError
|
||||
from DrissionPage.errors import CDPError
|
||||
|
||||
|
||||
class NetworkListener(object):
|
@ -1,10 +1,15 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from queue import Queue
|
||||
from typing import Union, Dict, List, Iterable, Tuple
|
||||
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
from chromium_base import ChromiumBase
|
||||
from chromium_driver import ChromiumDriver
|
||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
|
||||
|
||||
class NetworkListener(object):
|
@ -7,8 +7,8 @@ from pathlib import Path
|
||||
|
||||
from requests.structures import CaseInsensitiveDict
|
||||
|
||||
from .commons.tools import show_or_hide_browser
|
||||
from .commons.web import set_browser_cookies, set_session_cookies
|
||||
from DrissionPage._commons.tools import show_or_hide_browser
|
||||
from DrissionPage._commons.web import set_browser_cookies, set_session_cookies
|
||||
|
||||
|
||||
class ChromiumBaseSetter(object):
|
@ -11,13 +11,13 @@ from requests.adapters import HTTPAdapter
|
||||
from requests.auth import HTTPBasicAuth
|
||||
from requests.cookies import RequestsCookieJar
|
||||
|
||||
from .chromium_base import ChromiumBase, ChromiumPageScroll
|
||||
from .chromium_element import ChromiumElement
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_page import ChromiumPage
|
||||
from .chromium_tab import ChromiumTab
|
||||
from .session_page import SessionPage
|
||||
from .web_page import WebPage
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
||||
from DrissionPage._pages.session_page import SessionPage
|
||||
from DrissionPage._pages.web_page import WebPage
|
||||
|
||||
FILE_EXISTS = Literal['skip', 'rename', 'overwrite', 's', 'r', 'o']
|
||||
|
@ -1,8 +1,8 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
from time import sleep, perf_counter
|
||||
|
||||
from .commons.constants import Settings
|
||||
from .errors import WaitTimeoutError
|
||||
from DrissionPage._commons.constants import Settings
|
||||
from DrissionPage.errors import WaitTimeoutError
|
||||
|
||||
|
||||
class ChromiumBaseWaiter(object):
|
@ -5,11 +5,11 @@
|
||||
"""
|
||||
from typing import Union
|
||||
|
||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
||||
from .browser_download_manager import DownloadMission
|
||||
from .chromium_base import ChromiumBase
|
||||
from .chromium_element import ChromiumElement
|
||||
from .chromium_frame import ChromiumFrame
|
||||
from .chromium_page import ChromiumPage
|
||||
|
||||
|
||||
class ChromiumBaseWaiter(object):
|
@ -6,9 +6,9 @@
|
||||
"""
|
||||
from FlowViewer import Listener, RequestMan
|
||||
|
||||
from .session_element import make_session_ele
|
||||
from ._elements.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 ._units.action_chains import ActionChains
|
||||
from ._commons.keys import Keys
|
||||
from ._commons.by import By
|
||||
from ._commons.constants import Settings
|
||||
|
@ -1,7 +1,10 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
from .session_element import make_session_ele as make_session_ele
|
||||
|
||||
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
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
from ._commons.by import By as By
|
||||
from ._commons.constants import Settings as Settings
|
||||
from ._commons.keys import Keys as Keys
|
||||
from ._elements.session_element import make_session_ele as make_session_ele
|
||||
from ._units.action_chains import ActionChains as ActionChains
|
||||
|
@ -7,8 +7,8 @@ from os import popen
|
||||
from pathlib import Path
|
||||
from re import search
|
||||
|
||||
from .configs.chromium_options import ChromiumOptions
|
||||
from .configs.options_manage import OptionsManager
|
||||
from ._configs.chromium_options import ChromiumOptions
|
||||
from ._configs.options_manage import OptionsManager
|
||||
|
||||
|
||||
def configs_to_here(save_name=None):
|
||||
|
@ -1,4 +1,8 @@
|
||||
# -*- coding:utf-8 -*-
|
||||
"""
|
||||
@Author : g1879
|
||||
@Contact : g1879@qq.com
|
||||
"""
|
||||
|
||||
|
||||
class BaseError(Exception):
|
||||
|
Loading…
x
Reference in New Issue
Block a user