mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
调整项目文件目录
This commit is contained in:
parent
aafbc7a839
commit
f2b522b25e
@ -10,10 +10,10 @@ from urllib.parse import quote
|
|||||||
|
|
||||||
from DownloadKit import DownloadKit
|
from DownloadKit import DownloadKit
|
||||||
|
|
||||||
from DrissionPage._commons.constants import Settings, NoneElement
|
from .._commons.constants import Settings, NoneElement
|
||||||
from DrissionPage._commons.locator import get_loc
|
from .._commons.locator import get_loc
|
||||||
from DrissionPage._commons.web import format_html
|
from .._commons.web import format_html
|
||||||
from DrissionPage.errors import ElementNotFoundError
|
from ..errors import ElementNotFoundError
|
||||||
|
|
||||||
|
|
||||||
class BaseParser(object):
|
class BaseParser(object):
|
||||||
|
@ -8,7 +8,7 @@ from typing import Union, Tuple, List
|
|||||||
|
|
||||||
from DownloadKit import DownloadKit
|
from DownloadKit import DownloadKit
|
||||||
|
|
||||||
from DrissionPage._commons.constants import NoneElement
|
from .._commons.constants import NoneElement
|
||||||
|
|
||||||
|
|
||||||
class BaseParser(object):
|
class BaseParser(object):
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
"""
|
"""
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from DrissionPage._units.browser_download_manager import BrowserDownloadManager
|
|
||||||
from .chromium_driver import BrowserDriver
|
from .chromium_driver import BrowserDriver
|
||||||
|
from .._units.browser_download_manager import BrowserDownloadManager
|
||||||
|
|
||||||
|
|
||||||
class Browser(object):
|
class Browser(object):
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
"""
|
"""
|
||||||
from typing import List, Optional, Union
|
from typing import List, Optional, Union
|
||||||
|
|
||||||
from DrissionPage._units.browser_download_manager import BrowserDownloadManager
|
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
|
||||||
from .chromium_driver import BrowserDriver
|
from .chromium_driver import BrowserDriver
|
||||||
|
from .._pages.chromium_page import ChromiumPage
|
||||||
|
from .._units.browser_download_manager import BrowserDownloadManager
|
||||||
|
|
||||||
|
|
||||||
class Browser(object):
|
class Browser(object):
|
||||||
|
@ -12,7 +12,7 @@ from platform import system
|
|||||||
|
|
||||||
from requests import get as requests_get
|
from requests import get as requests_get
|
||||||
|
|
||||||
from DrissionPage.errors import BrowserConnectError
|
from ..errors import BrowserConnectError
|
||||||
from .tools import port_is_using
|
from .tools import port_is_using
|
||||||
|
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ def connect_browser(option):
|
|||||||
|
|
||||||
# 传入的路径找不到,主动在ini文件、注册表、系统变量中找
|
# 传入的路径找不到,主动在ini文件、注册表、系统变量中找
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
from DrissionPage.easy_set import get_chrome_path
|
from ..easy_set import get_chrome_path
|
||||||
chrome_path = get_chrome_path(show_msg=False)
|
chrome_path = get_chrome_path(show_msg=False)
|
||||||
|
|
||||||
if not chrome_path:
|
if not chrome_path:
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
@Author : g1879
|
@Author : g1879
|
||||||
@Contact : g1879@qq.com
|
@Contact : g1879@qq.com
|
||||||
"""
|
"""
|
||||||
from DrissionPage._configs.chromium_options import ChromiumOptions
|
from .._configs.chromium_options import ChromiumOptions
|
||||||
|
|
||||||
|
|
||||||
def connect_browser(option: ChromiumOptions) -> tuple: ...
|
def connect_browser(option: ChromiumOptions) -> tuple: ...
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
"""
|
"""
|
||||||
from click import command, option
|
from click import command, option
|
||||||
|
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
from .._pages.chromium_page import ChromiumPage
|
||||||
from DrissionPage.easy_set import set_paths, configs_to_here as ch
|
from ..easy_set import set_paths, configs_to_here as ch
|
||||||
|
|
||||||
|
|
||||||
@command()
|
@command()
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
@Author : g1879
|
@Author : g1879
|
||||||
@Contact : g1879@qq.com
|
@Contact : g1879@qq.com
|
||||||
"""
|
"""
|
||||||
from DrissionPage.errors import ElementNotFoundError
|
from ..errors import ElementNotFoundError
|
||||||
|
|
||||||
HANDLE_ALERT_METHOD = 'Page.handleJavaScriptDialog'
|
HANDLE_ALERT_METHOD = 'Page.handleJavaScriptDialog'
|
||||||
FRAME_ELEMENT = ('iframe', 'frame')
|
FRAME_ELEMENT = ('iframe', 'frame')
|
||||||
|
@ -8,7 +8,7 @@ from pathlib import Path
|
|||||||
from typing import Union
|
from typing import Union
|
||||||
from types import FunctionType
|
from types import FunctionType
|
||||||
|
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
from .._pages.chromium_page import ChromiumPage
|
||||||
|
|
||||||
|
|
||||||
def get_usable_path(path: Union[str, Path], is_file: bool = True, parents: bool = True) -> Path: ...
|
def get_usable_path(path: Union[str, Path], is_file: bool = True, parents: bool = True) -> Path: ...
|
||||||
|
@ -9,9 +9,9 @@ from typing import Union
|
|||||||
from requests import Session
|
from requests import Session
|
||||||
from requests.cookies import RequestsCookieJar
|
from requests.cookies import RequestsCookieJar
|
||||||
|
|
||||||
from DrissionPage.base import DrissionElement, BasePage
|
from .._elements.chromium_element import ChromiumElement
|
||||||
from DrissionPage._chromium_element import ChromiumElement
|
from .._pages.chromium_base import ChromiumBase
|
||||||
from DrissionPage._chromium_base import ChromiumBase
|
from ..base import DrissionElement, BasePage
|
||||||
|
|
||||||
|
|
||||||
def get_ele_txt(e: DrissionElement) -> str: ...
|
def get_ele_txt(e: DrissionElement) -> str: ...
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import gettempdir, TemporaryDirectory
|
from tempfile import gettempdir, TemporaryDirectory
|
||||||
|
|
||||||
from DrissionPage._commons.tools import port_is_using, clean_folder
|
|
||||||
from .options_manage import OptionsManager
|
from .options_manage import OptionsManager
|
||||||
|
from .._commons.tools import port_is_using, clean_folder
|
||||||
|
|
||||||
|
|
||||||
class ChromiumOptions(object):
|
class ChromiumOptions(object):
|
||||||
|
@ -8,8 +8,8 @@ from pathlib import Path
|
|||||||
from requests import Session
|
from requests import Session
|
||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
from DrissionPage._commons.web import cookies_to_tuple, set_session_cookies
|
|
||||||
from .options_manage import OptionsManager
|
from .options_manage import OptionsManager
|
||||||
|
from .._commons.web import cookies_to_tuple, set_session_cookies
|
||||||
|
|
||||||
|
|
||||||
class SessionOptions(object):
|
class SessionOptions(object):
|
||||||
|
@ -7,17 +7,17 @@ from os.path import basename, sep
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from time import perf_counter, sleep
|
from time import perf_counter, sleep
|
||||||
|
|
||||||
from DrissionPage._base.base import DrissionElement, BaseElement
|
from .._base.base import DrissionElement, BaseElement
|
||||||
from DrissionPage._commons.constants import FRAME_ELEMENT, NoneElement, Settings
|
from .._commons.constants import FRAME_ELEMENT, NoneElement, Settings
|
||||||
from DrissionPage._commons.keys import keys_to_typing, keyDescriptionForString, keyDefinitions
|
from .._commons.keys import keys_to_typing, keyDescriptionForString, keyDefinitions
|
||||||
from DrissionPage._commons.locator import get_loc
|
from .._commons.locator import get_loc
|
||||||
from DrissionPage._commons.tools import get_usable_path
|
from .._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 .._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, \
|
from ..errors import ContextLossError, ElementLossError, JavaScriptError, NoRectError, ElementNotFoundError, \
|
||||||
CDPError, NoResourceError, CanNotClickError
|
CDPError, NoResourceError, CanNotClickError
|
||||||
from .session_element import make_session_ele
|
from .session_element import make_session_ele
|
||||||
from DrissionPage._units.setter import ChromiumElementSetter
|
from .._units.setter import ChromiumElementSetter
|
||||||
from DrissionPage._units.waiter import ChromiumElementWaiter
|
from .._units.waiter import ChromiumElementWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumElement(DrissionElement):
|
class ChromiumElement(DrissionElement):
|
||||||
@ -641,7 +641,7 @@ class ChromiumElement(DrissionElement):
|
|||||||
points = [(int(current_x + i * (width / num)), int(current_y + i * (height / num))) for i in range(1, num)]
|
points = [(int(current_x + i * (width / num)), int(current_y + i * (height / num))) for i in range(1, num)]
|
||||||
points.append((target_x, target_y))
|
points.append((target_x, target_y))
|
||||||
|
|
||||||
from .action_chains import ActionChains
|
from .._units.action_chains import ActionChains
|
||||||
actions = ActionChains(self.page)
|
actions = ActionChains(self.page)
|
||||||
actions.hold(self)
|
actions.hold(self)
|
||||||
|
|
||||||
@ -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)
|
ele = ChromiumElement(page, obj_id=obj_id, node_id=node_id, backend_id=backend_id)
|
||||||
if ele.tag in FRAME_ELEMENT:
|
if ele.tag in FRAME_ELEMENT:
|
||||||
from ._chromium_frame import ChromiumFrame
|
from .._pages.chromium_frame import ChromiumFrame
|
||||||
ele = ChromiumFrame(page, ele)
|
ele = ChromiumFrame(page, ele)
|
||||||
|
|
||||||
return ele
|
return ele
|
||||||
|
@ -6,15 +6,15 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Union, Tuple, List, Any
|
from typing import Union, Tuple, List, Any
|
||||||
|
|
||||||
from DrissionPage._base.base import DrissionElement, BaseElement
|
from .._base.base import DrissionElement, BaseElement
|
||||||
from DrissionPage._commons.constants import NoneElement
|
from .._commons.constants import NoneElement
|
||||||
from DrissionPage._elements.session_element import SessionElement
|
from .._elements.session_element import SessionElement
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
from .._pages.chromium_base import ChromiumBase
|
||||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
from .._pages.chromium_frame import ChromiumFrame
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
from .._pages.chromium_page import ChromiumPage
|
||||||
from DrissionPage._pages.web_page import WebPage
|
from .._pages.web_page import WebPage
|
||||||
from DrissionPage._units.setter import ChromiumElementSetter
|
from .._units.setter import ChromiumElementSetter
|
||||||
from DrissionPage._units.waiter import ChromiumElementWaiter
|
from .._units.waiter import ChromiumElementWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumElement(DrissionElement):
|
class ChromiumElement(DrissionElement):
|
||||||
|
@ -9,10 +9,10 @@ from re import match, DOTALL
|
|||||||
from lxml.etree import tostring
|
from lxml.etree import tostring
|
||||||
from lxml.html import HtmlElement, fromstring
|
from lxml.html import HtmlElement, fromstring
|
||||||
|
|
||||||
from DrissionPage._base.base import DrissionElement, BasePage, BaseElement
|
from .._base.base import DrissionElement, BasePage, BaseElement
|
||||||
from DrissionPage._commons.constants import NoneElement
|
from .._commons.constants import NoneElement
|
||||||
from DrissionPage._commons.locator import get_loc
|
from .._commons.locator import get_loc
|
||||||
from DrissionPage._commons.web import get_ele_txt, make_absolute_link
|
from .._commons.web import get_ele_txt, make_absolute_link
|
||||||
|
|
||||||
|
|
||||||
class SessionElement(DrissionElement):
|
class SessionElement(DrissionElement):
|
||||||
|
@ -7,12 +7,12 @@ from typing import Union, List, Tuple
|
|||||||
|
|
||||||
from lxml.html import HtmlElement
|
from lxml.html import HtmlElement
|
||||||
|
|
||||||
from DrissionPage._base.base import DrissionElement, BaseElement
|
from .._base.base import DrissionElement, BaseElement
|
||||||
from DrissionPage._commons.constants import NoneElement
|
from .._commons.constants import NoneElement
|
||||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
from .._elements.chromium_element import ChromiumElement
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
from .._pages.chromium_base import ChromiumBase
|
||||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
from .._pages.chromium_frame import ChromiumFrame
|
||||||
from DrissionPage._pages.session_page import SessionPage
|
from .._pages.session_page import SessionPage
|
||||||
|
|
||||||
|
|
||||||
class SessionElement(DrissionElement):
|
class SessionElement(DrissionElement):
|
||||||
|
@ -13,20 +13,20 @@ from time import perf_counter, sleep, time
|
|||||||
|
|
||||||
from requests import get
|
from requests import get
|
||||||
|
|
||||||
from DrissionPage._base.base import BasePage
|
from .._base.base import BasePage
|
||||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
from .._base.chromium_driver import ChromiumDriver
|
||||||
from DrissionPage._commons.constants import HANDLE_ALERT_METHOD, ERROR, NoneElement
|
from .._commons.constants import HANDLE_ALERT_METHOD, ERROR, NoneElement
|
||||||
from DrissionPage._commons.locator import get_loc
|
from .._commons.locator import get_loc
|
||||||
from DrissionPage._commons.tools import get_usable_path, clean_folder
|
from .._commons.tools import get_usable_path, clean_folder
|
||||||
from DrissionPage._commons.web import location_in_viewport
|
from .._commons.web import location_in_viewport
|
||||||
from DrissionPage._elements.chromium_element import ChromiumScroll, ChromiumElement, run_js, make_chromium_ele
|
from .._elements.chromium_element import ChromiumScroll, ChromiumElement, run_js, make_chromium_ele
|
||||||
from DrissionPage._elements.session_element import make_session_ele
|
from .._elements.session_element import make_session_ele
|
||||||
from DrissionPage._units.network_listener import NetworkListener
|
from .._units.action_chains import ActionChains
|
||||||
from DrissionPage._units.setter import ChromiumBaseSetter
|
from .._units.network_listener import NetworkListener
|
||||||
from DrissionPage._units.waiter import ChromiumBaseWaiter
|
from .._units.setter import ChromiumBaseSetter
|
||||||
from DrissionPage.errors import ContextLossError, ElementLossError, AlertExistsError, CDPError, TabClosedError, \
|
from .._units.waiter import ChromiumBaseWaiter
|
||||||
|
from ..errors import ContextLossError, ElementLossError, AlertExistsError, CDPError, TabClosedError, \
|
||||||
NoRectError, BrowserConnectError, GetDocumentError
|
NoRectError, BrowserConnectError, GetDocumentError
|
||||||
from _units.action_chains import ActionChains
|
|
||||||
|
|
||||||
|
|
||||||
class ChromiumBase(BasePage):
|
class ChromiumBase(BasePage):
|
||||||
|
@ -8,18 +8,18 @@ from typing import Union, Tuple, List, Any
|
|||||||
|
|
||||||
from DataRecorder import Recorder
|
from DataRecorder import Recorder
|
||||||
|
|
||||||
from DrissionPage._base.base import BasePage
|
from .._base.base import BasePage
|
||||||
from DrissionPage._base.browser import Browser
|
from .._base.browser import Browser
|
||||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
from .._base.chromium_driver import ChromiumDriver
|
||||||
from DrissionPage._commons.constants import NoneElement
|
from .._commons.constants import NoneElement
|
||||||
from DrissionPage._elements.chromium_element import ChromiumElement, ChromiumScroll
|
from .._elements.chromium_element import ChromiumElement, ChromiumScroll
|
||||||
from DrissionPage._elements.session_element import SessionElement
|
from .._elements.session_element import SessionElement
|
||||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
from .._pages.chromium_frame import ChromiumFrame
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
from .._pages.chromium_page import ChromiumPage
|
||||||
from DrissionPage._units.action_chains import ActionChains
|
from .._units.action_chains import ActionChains
|
||||||
from DrissionPage._units.network_listener import NetworkListener
|
from .._units.network_listener import NetworkListener
|
||||||
from DrissionPage._units.setter import ChromiumBaseSetter
|
from .._units.setter import ChromiumBaseSetter
|
||||||
from DrissionPage._units.waiter import ChromiumBaseWaiter
|
from .._units.waiter import ChromiumBaseWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumBase(BasePage):
|
class ChromiumBase(BasePage):
|
||||||
|
@ -10,11 +10,11 @@ from time import sleep, perf_counter
|
|||||||
|
|
||||||
from requests import get
|
from requests import get
|
||||||
|
|
||||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
from .._elements.chromium_element import ChromiumElement
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
from .._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
||||||
from DrissionPage._units.setter import ChromiumFrameSetter
|
from .._units.setter import ChromiumFrameSetter
|
||||||
from DrissionPage._units.waiter import FrameWaiter
|
from .._units.waiter import FrameWaiter
|
||||||
from DrissionPage.errors import ContextLossError
|
from ..errors import ContextLossError
|
||||||
|
|
||||||
|
|
||||||
class ChromiumFrame(ChromiumBase):
|
class ChromiumFrame(ChromiumBase):
|
||||||
|
@ -6,13 +6,13 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Union, Tuple, List, Any
|
from typing import Union, Tuple, List, Any
|
||||||
|
|
||||||
from DrissionPage._elements.chromium_element import ChromiumElement, Locations, ChromiumElementStates
|
from .chromium_base import ChromiumBase, ChromiumPageScroll
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
from .chromium_page import ChromiumPage
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
from .chromium_tab import ChromiumTab
|
||||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
from .web_page import WebPage
|
||||||
from DrissionPage._pages.web_page import WebPage
|
from .._elements.chromium_element import ChromiumElement, Locations, ChromiumElementStates
|
||||||
from DrissionPage._units.setter import ChromiumFrameSetter
|
from .._units.setter import ChromiumFrameSetter
|
||||||
from DrissionPage._units.waiter import FrameWaiter
|
from .._units.waiter import FrameWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumFrame(ChromiumBase):
|
class ChromiumFrame(ChromiumBase):
|
||||||
|
@ -8,14 +8,14 @@ from time import perf_counter, sleep
|
|||||||
|
|
||||||
from requests import get
|
from requests import get
|
||||||
|
|
||||||
from DrissionPage._base.browser import Browser
|
from .._base.browser import Browser
|
||||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
from .._base.chromium_driver import ChromiumDriver
|
||||||
from DrissionPage._commons.browser import connect_browser
|
from .._commons.browser import connect_browser
|
||||||
from DrissionPage._configs.chromium_options import ChromiumOptions
|
from .._configs.chromium_options import ChromiumOptions
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase, Timeout
|
from .._pages.chromium_base import ChromiumBase, Timeout
|
||||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
from .._pages.chromium_tab import ChromiumTab
|
||||||
from DrissionPage._units.setter import ChromiumPageSetter
|
from .._units.setter import ChromiumPageSetter
|
||||||
from DrissionPage._units.waiter import ChromiumPageWaiter
|
from .._units.waiter import ChromiumPageWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumPage(ChromiumBase):
|
class ChromiumPage(ChromiumBase):
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
"""
|
"""
|
||||||
from typing import Union, Tuple, List, Optional
|
from typing import Union, Tuple, List, Optional
|
||||||
|
|
||||||
from DrissionPage._base.browser import Browser
|
from .._base.browser import Browser
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
from .._pages.chromium_base import ChromiumBase
|
||||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
from .._base.chromium_driver import ChromiumDriver
|
||||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
from .._pages.chromium_tab import ChromiumTab
|
||||||
from DrissionPage._configs.chromium_options import ChromiumOptions
|
from .._configs.chromium_options import ChromiumOptions
|
||||||
from DrissionPage._units.setter import ChromiumPageSetter
|
from .._units.setter import ChromiumPageSetter
|
||||||
from DrissionPage._units.waiter import ChromiumPageWaiter
|
from .._units.waiter import ChromiumPageWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumPage(ChromiumBase):
|
class ChromiumPage(ChromiumBase):
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
"""
|
"""
|
||||||
from copy import copy
|
from copy import copy
|
||||||
|
|
||||||
from DrissionPage._base.base import BasePage
|
from .._base.base import BasePage
|
||||||
from DrissionPage._commons.web import set_session_cookies, set_browser_cookies
|
from .._commons.web import set_session_cookies, set_browser_cookies
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
from .._pages.chromium_base import ChromiumBase
|
||||||
from DrissionPage._pages.session_page import SessionPage
|
from .._pages.session_page import SessionPage
|
||||||
from DrissionPage._units.setter import TabSetter, WebPageTabSetter
|
from .._units.setter import TabSetter, WebPageTabSetter
|
||||||
from DrissionPage._units.waiter import ChromiumTabWaiter
|
from .._units.waiter import ChromiumTabWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumTab(ChromiumBase):
|
class ChromiumTab(ChromiumBase):
|
||||||
|
@ -7,16 +7,16 @@ from typing import Union, Tuple, Any, List
|
|||||||
|
|
||||||
from requests import Session, Response
|
from requests import Session, Response
|
||||||
|
|
||||||
from DrissionPage._base.browser import Browser
|
from .chromium_base import ChromiumBase
|
||||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
from .chromium_frame import ChromiumFrame
|
||||||
from DrissionPage._elements.session_element import SessionElement
|
from .chromium_page import ChromiumPage, ChromiumTabRect
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
from .session_page import SessionPage
|
||||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
from .web_page import WebPage
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage, ChromiumTabRect
|
from .._base.browser import Browser
|
||||||
from DrissionPage._pages.session_page import SessionPage
|
from .._elements.chromium_element import ChromiumElement
|
||||||
from DrissionPage._pages.web_page import WebPage
|
from .._elements.session_element import SessionElement
|
||||||
from DrissionPage._units.setter import TabSetter, WebPageTabSetter
|
from .._units.setter import TabSetter, WebPageTabSetter
|
||||||
from DrissionPage._units.waiter import ChromiumTabWaiter
|
from .._units.waiter import ChromiumTabWaiter
|
||||||
|
|
||||||
|
|
||||||
class ChromiumTab(ChromiumBase):
|
class ChromiumTab(ChromiumBase):
|
||||||
|
@ -11,11 +11,11 @@ from requests import Session
|
|||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
from tldextract import extract
|
from tldextract import extract
|
||||||
|
|
||||||
from DrissionPage._base.base import BasePage
|
from .._base.base import BasePage
|
||||||
from DrissionPage._commons.web import cookie_to_dict
|
from .._commons.web import cookie_to_dict
|
||||||
from DrissionPage._configs.session_options import SessionOptions
|
from .._configs.session_options import SessionOptions
|
||||||
from DrissionPage._elements.session_element import SessionElement, make_session_ele
|
from .._elements.session_element import SessionElement, make_session_ele
|
||||||
from DrissionPage._units.setter import SessionPageSetter
|
from .._units.setter import SessionPageSetter
|
||||||
|
|
||||||
|
|
||||||
class SessionPage(BasePage):
|
class SessionPage(BasePage):
|
||||||
|
@ -8,11 +8,11 @@ from typing import Any, Union, Tuple, List
|
|||||||
from requests import Session, Response
|
from requests import Session, Response
|
||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
from DrissionPage._base.base import BasePage
|
from .._base.base import BasePage
|
||||||
from DrissionPage._commons.constants import NoneElement
|
from .._commons.constants import NoneElement
|
||||||
from DrissionPage._configs.session_options import SessionOptions
|
from .._configs.session_options import SessionOptions
|
||||||
from DrissionPage._elements.session_element import SessionElement
|
from .._elements.session_element import SessionElement
|
||||||
from DrissionPage._units.setter import SessionPageSetter
|
from .._units.setter import SessionPageSetter
|
||||||
|
|
||||||
|
|
||||||
class SessionPage(BasePage):
|
class SessionPage(BasePage):
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
@Author : g1879
|
@Author : g1879
|
||||||
@Contact : g1879@qq.com
|
@Contact : g1879@qq.com
|
||||||
"""
|
"""
|
||||||
from DrissionPage._base.base import BasePage
|
from .chromium_page import ChromiumPage
|
||||||
from DrissionPage._commons.web import set_session_cookies, set_browser_cookies
|
from .chromium_tab import WebPageTab
|
||||||
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 .session_page import SessionPage
|
||||||
|
from .._base.base import BasePage
|
||||||
|
from .._commons.web import set_session_cookies, set_browser_cookies
|
||||||
|
from .._configs.chromium_options import ChromiumOptions
|
||||||
|
from .._units.setter import WebPageSetter
|
||||||
|
|
||||||
|
|
||||||
class WebPage(SessionPage, ChromiumPage, BasePage):
|
class WebPage(SessionPage, ChromiumPage, BasePage):
|
||||||
|
@ -7,17 +7,17 @@ from typing import Union, Tuple, List, Any
|
|||||||
|
|
||||||
from requests import Session, Response
|
from requests import Session, Response
|
||||||
|
|
||||||
from ._base import BasePage
|
|
||||||
from ._chromium_driver import ChromiumDriver
|
|
||||||
from ._chromium_element import ChromiumElement
|
|
||||||
from .chromium_frame import ChromiumFrame
|
from .chromium_frame import ChromiumFrame
|
||||||
from .chromium_page import ChromiumPage
|
from .chromium_page import ChromiumPage
|
||||||
from .chromium_tab import WebPageTab
|
from .chromium_tab import WebPageTab
|
||||||
from ._configs.chromium_options import ChromiumOptions
|
|
||||||
from ._configs.session_options import SessionOptions
|
|
||||||
from ._session_element import SessionElement
|
|
||||||
from .session_page import SessionPage
|
from .session_page import SessionPage
|
||||||
from ._units.setter import WebPageSetter
|
from .._base.base import BasePage
|
||||||
|
from .._base.chromium_driver import ChromiumDriver
|
||||||
|
from .._configs.chromium_options import ChromiumOptions
|
||||||
|
from .._configs.session_options import SessionOptions
|
||||||
|
from .._elements.chromium_element import ChromiumElement
|
||||||
|
from .._elements.session_element import SessionElement
|
||||||
|
from .._units.setter import WebPageSetter
|
||||||
|
|
||||||
|
|
||||||
class WebPage(SessionPage, ChromiumPage, BasePage):
|
class WebPage(SessionPage, ChromiumPage, BasePage):
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
"""
|
"""
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
from DrissionPage._commons.keys import modifierBit, keyDescriptionForString
|
from .._commons.keys import modifierBit, keyDescriptionForString
|
||||||
from DrissionPage._commons.web import location_in_viewport
|
from .._commons.web import location_in_viewport
|
||||||
|
|
||||||
|
|
||||||
class ActionChains:
|
class ActionChains:
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
"""
|
"""
|
||||||
from typing import Union, Tuple
|
from typing import Union, Tuple
|
||||||
|
|
||||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
from .._base.chromium_driver import ChromiumDriver
|
||||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
from .._elements.chromium_element import ChromiumElement
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
from .._pages.chromium_base import ChromiumBase
|
||||||
|
|
||||||
|
|
||||||
class ActionChains:
|
class ActionChains:
|
||||||
|
@ -1,10 +1,14 @@
|
|||||||
# -*- coding:utf-8 -*-
|
# -*- coding:utf-8 -*-
|
||||||
|
"""
|
||||||
|
@Author : g1879
|
||||||
|
@Contact : g1879@qq.com
|
||||||
|
"""
|
||||||
from os.path import sep
|
from os.path import sep
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from shutil import move
|
from shutil import move
|
||||||
from time import sleep, perf_counter
|
from time import sleep, perf_counter
|
||||||
|
|
||||||
from DrissionPage._commons.tools import get_usable_path
|
from .._commons.tools import get_usable_path
|
||||||
|
|
||||||
|
|
||||||
class BrowserDownloadManager(object):
|
class BrowserDownloadManager(object):
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, Optional, Union
|
from typing import Dict, Optional, Union
|
||||||
|
|
||||||
from DrissionPage._base.browser import Browser
|
from .._base.browser import Browser
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
from .._pages.chromium_page import ChromiumPage
|
||||||
|
|
||||||
|
|
||||||
class BrowserDownloadManager(object):
|
class BrowserDownloadManager(object):
|
||||||
|
@ -12,7 +12,7 @@ from time import perf_counter, sleep
|
|||||||
|
|
||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
from DrissionPage.errors import CDPError
|
from ..errors import CDPError
|
||||||
|
|
||||||
|
|
||||||
class NetworkListener(object):
|
class NetworkListener(object):
|
||||||
|
@ -8,8 +8,8 @@ from typing import Union, Dict, List, Iterable, Tuple
|
|||||||
|
|
||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
from DrissionPage._base.chromium_driver import ChromiumDriver
|
from .._base.chromium_driver import ChromiumDriver
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase
|
from .._pages.chromium_base import ChromiumBase
|
||||||
|
|
||||||
|
|
||||||
class NetworkListener(object):
|
class NetworkListener(object):
|
||||||
|
@ -7,8 +7,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
from requests.structures import CaseInsensitiveDict
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
from DrissionPage._commons.tools import show_or_hide_browser
|
from .._commons.tools import show_or_hide_browser
|
||||||
from DrissionPage._commons.web import set_browser_cookies, set_session_cookies
|
from .._commons.web import set_browser_cookies, set_session_cookies
|
||||||
|
|
||||||
|
|
||||||
class ChromiumBaseSetter(object):
|
class ChromiumBaseSetter(object):
|
||||||
|
@ -11,13 +11,13 @@ from requests.adapters import HTTPAdapter
|
|||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
from requests.cookies import RequestsCookieJar
|
from requests.cookies import RequestsCookieJar
|
||||||
|
|
||||||
from DrissionPage._elements.chromium_element import ChromiumElement
|
from .._elements.chromium_element import ChromiumElement
|
||||||
from DrissionPage._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
from .._pages.chromium_base import ChromiumBase, ChromiumPageScroll
|
||||||
from DrissionPage._pages.chromium_frame import ChromiumFrame
|
from .._pages.chromium_frame import ChromiumFrame
|
||||||
from DrissionPage._pages.chromium_page import ChromiumPage
|
from .._pages.chromium_page import ChromiumPage
|
||||||
from DrissionPage._pages.chromium_tab import ChromiumTab
|
from .._pages.chromium_tab import ChromiumTab
|
||||||
from DrissionPage._pages.session_page import SessionPage
|
from .._pages.session_page import SessionPage
|
||||||
from DrissionPage._pages.web_page import WebPage
|
from .._pages.web_page import WebPage
|
||||||
|
|
||||||
FILE_EXISTS = Literal['skip', 'rename', 'overwrite', 's', 'r', 'o']
|
FILE_EXISTS = Literal['skip', 'rename', 'overwrite', 's', 'r', 'o']
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# -*- coding:utf-8 -*-
|
# -*- coding:utf-8 -*-
|
||||||
from time import sleep, perf_counter
|
from time import sleep, perf_counter
|
||||||
|
|
||||||
from DrissionPage._commons.constants import Settings
|
from .._commons.constants import Settings
|
||||||
from DrissionPage.errors import WaitTimeoutError
|
from ..errors import WaitTimeoutError
|
||||||
|
|
||||||
|
|
||||||
class ChromiumBaseWaiter(object):
|
class ChromiumBaseWaiter(object):
|
||||||
|
@ -5,11 +5,11 @@
|
|||||||
"""
|
"""
|
||||||
from typing import Union
|
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 .browser_download_manager import DownloadMission
|
||||||
|
from .._elements.chromium_element import ChromiumElement
|
||||||
|
from .._pages.chromium_base import ChromiumBase
|
||||||
|
from .._pages.chromium_frame import ChromiumFrame
|
||||||
|
from .._pages.chromium_page import ChromiumPage
|
||||||
|
|
||||||
|
|
||||||
class ChromiumBaseWaiter(object):
|
class ChromiumBaseWaiter(object):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user