diff --git a/DrissionPage/base.py b/DrissionPage/base.py index c77fccf..16496b3 100644 --- a/DrissionPage/base.py +++ b/DrissionPage/base.py @@ -8,9 +8,9 @@ from re import sub from urllib.parse import quote from .common.constants import Settings, NoneElement -from .common.errors import ElementNotFoundError -from .common.web import format_html from .common.locator import get_loc +from .common.web import format_html +from .errors import ElementNotFoundError class BaseParser(object): diff --git a/DrissionPage/chromium_base.py b/DrissionPage/chromium_base.py index 559e1fb..be47d53 100644 --- a/DrissionPage/chromium_base.py +++ b/DrissionPage/chromium_base.py @@ -15,11 +15,11 @@ from .chromium_driver import ChromiumDriver from .chromium_element import ChromiumWaiter, ChromiumScroll, ChromiumElement, run_js, make_chromium_ele, \ ChromiumElementWaiter from .common.constants import HANDLE_ALERT_METHOD, ERROR, NoneElement -from .common.errors import ContextLossError, ElementLossError, AlertExistsError, CallMethodError, TabClosedError, \ - NoRectError from .common.locator import get_loc from .common.tools import get_usable_path from .common.web import cookies_to_tuple +from .errors import ContextLossError, ElementLossError, AlertExistsError, CallMethodError, TabClosedError, \ + NoRectError from .session_element import make_session_ele diff --git a/DrissionPage/chromium_driver.py b/DrissionPage/chromium_driver.py index 85f7f1c..99268bb 100644 --- a/DrissionPage/chromium_driver.py +++ b/DrissionPage/chromium_driver.py @@ -11,7 +11,7 @@ from threading import Thread, Event from websocket import WebSocketTimeoutException, WebSocketException, WebSocketConnectionClosedException, \ create_connection -from .common.errors import CallMethodError +from .errors import CallMethodError class GenericAttr(object): diff --git a/DrissionPage/chromium_element.py b/DrissionPage/chromium_element.py index a06c1ac..1c408a6 100644 --- a/DrissionPage/chromium_element.py +++ b/DrissionPage/chromium_element.py @@ -11,11 +11,11 @@ from warnings import warn from .base import DrissionElement, BaseElement from .common.constants import FRAME_ELEMENT, NoneElement, Settings -from .common.errors import ContextLossError, ElementLossError, JavaScriptError, NoRectError, ElementNotFoundError, \ - CallMethodError from .common.keys import keys_to_typing, keyDescriptionForString, keyDefinitions from .common.locator import get_loc from .common.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, \ + CallMethodError from .session_element import make_session_ele diff --git a/DrissionPage/chromium_page.py b/DrissionPage/chromium_page.py index fce221e..06d2bf2 100644 --- a/DrissionPage/chromium_page.py +++ b/DrissionPage/chromium_page.py @@ -15,9 +15,9 @@ from .chromium_base import ChromiumBase, Timeout, ChromiumBaseSetter from .chromium_driver import ChromiumDriver from .chromium_tab import ChromiumTab from .common.browser import connect_browser -from .common.errors import CallMethodError from .common.web import set_session_cookies from .configs.chromium_options import ChromiumOptions +from .errors import CallMethodError from .session_page import DownloadSetter diff --git a/DrissionPage/common/constants.py b/DrissionPage/common/constants.py index e906d25..bcfc6fa 100644 --- a/DrissionPage/common/constants.py +++ b/DrissionPage/common/constants.py @@ -1,5 +1,9 @@ # -*- coding:utf-8 -*- -from .errors import ElementNotFoundError +""" +@Author : g1879 +@Contact : g1879@qq.com +""" +from DrissionPage.errors import ElementNotFoundError HANDLE_ALERT_METHOD = 'Page.handleJavaScriptDialog' FRAME_ELEMENT = ('iframe', 'frame') diff --git a/DrissionPage/common/errors.py b/DrissionPage/errors.py similarity index 100% rename from DrissionPage/common/errors.py rename to DrissionPage/errors.py diff --git a/DrissionPage/web_page.py b/DrissionPage/web_page.py index f2aa17f..c36c694 100644 --- a/DrissionPage/web_page.py +++ b/DrissionPage/web_page.py @@ -13,9 +13,9 @@ from .base import BasePage from .chromium_base import ChromiumBase, Timeout from .chromium_driver import ChromiumDriver from .chromium_page import ChromiumPage, ChromiumDownloadSetter, ChromiumPageSetter -from .common.errors import CallMethodError from .configs.chromium_options import ChromiumOptions from .configs.session_options import SessionOptions +from .errors import CallMethodError from .session_page import SessionPage, SessionPageSetter