mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
4.0.4.11修复两个小问题
This commit is contained in:
parent
c7592c6a49
commit
4a71435c4b
@ -14,4 +14,4 @@ from ._configs.chromium_options import ChromiumOptions
|
|||||||
from ._configs.session_options import SessionOptions
|
from ._configs.session_options import SessionOptions
|
||||||
|
|
||||||
__all__ = ['ChromiumPage', 'ChromiumOptions', 'SessionOptions', 'SessionPage', 'WebPage', '__version__']
|
__all__ = ['ChromiumPage', 'ChromiumOptions', 'SessionOptions', 'SessionPage', 'WebPage', '__version__']
|
||||||
__version__ = '4.0.4.10'
|
__version__ = '4.0.4.11'
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||||
@License : BSD 3-Clause.
|
@License : BSD 3-Clause.
|
||||||
"""
|
"""
|
||||||
|
from copy import copy
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from requests import Session
|
from requests import Session
|
||||||
@ -441,7 +442,7 @@ class SessionOptions(object):
|
|||||||
:param headers: headers
|
:param headers: headers
|
||||||
:return: 当前对象
|
:return: 当前对象
|
||||||
"""
|
"""
|
||||||
self._headers = CaseInsensitiveDict(**session.headers, **headers) if headers else session.headers
|
self._headers = CaseInsensitiveDict(copy(session.headers).update(headers)) if headers else session.headers
|
||||||
self._cookies = session.cookies
|
self._cookies = session.cookies
|
||||||
self._auth = session.auth
|
self._auth = session.auth
|
||||||
self._proxies = session.proxies
|
self._proxies = session.proxies
|
||||||
|
@ -98,7 +98,8 @@ class ChromiumElement(DrissionElement):
|
|||||||
:param item: 属性名
|
:param item: 属性名
|
||||||
:return: 属性值
|
:return: 属性值
|
||||||
"""
|
"""
|
||||||
return self.attr(item) or self.property(item)
|
a = self.attr(item)
|
||||||
|
return a if a is not None else self.property(item)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tag(self):
|
def tag(self):
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||||
@License : BSD 3-Clause.
|
@License : BSD 3-Clause.
|
||||||
"""
|
"""
|
||||||
|
from copy import copy
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from re import search, DOTALL
|
from re import search, DOTALL
|
||||||
from time import sleep
|
from time import sleep
|
||||||
@ -56,9 +57,9 @@ class SessionPage(BasePage):
|
|||||||
|
|
||||||
elif isinstance(session_or_options, Session):
|
elif isinstance(session_or_options, Session):
|
||||||
self._session_options = SessionOptions()
|
self._session_options = SessionOptions()
|
||||||
self._headers = session_or_options.headers
|
self._session = copy(session_or_options)
|
||||||
session_or_options.headers = None
|
self._headers = self._session.headers
|
||||||
self._session = session_or_options
|
self._session.headers = None
|
||||||
|
|
||||||
def _s_set_runtime_settings(self):
|
def _s_set_runtime_settings(self):
|
||||||
"""设置运行时用到的属性"""
|
"""设置运行时用到的属性"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user