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
|
||||
|
||||
__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.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from copy import copy
|
||||
from pathlib import Path
|
||||
|
||||
from requests import Session
|
||||
@ -441,7 +442,7 @@ class SessionOptions(object):
|
||||
:param headers: headers
|
||||
: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._auth = session.auth
|
||||
self._proxies = session.proxies
|
||||
|
@ -98,7 +98,8 @@ class ChromiumElement(DrissionElement):
|
||||
:param item: 属性名
|
||||
: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
|
||||
def tag(self):
|
||||
|
@ -5,6 +5,7 @@
|
||||
@Copyright: (c) 2024 by g1879, Inc. All Rights Reserved.
|
||||
@License : BSD 3-Clause.
|
||||
"""
|
||||
from copy import copy
|
||||
from pathlib import Path
|
||||
from re import search, DOTALL
|
||||
from time import sleep
|
||||
@ -56,9 +57,9 @@ class SessionPage(BasePage):
|
||||
|
||||
elif isinstance(session_or_options, Session):
|
||||
self._session_options = SessionOptions()
|
||||
self._headers = session_or_options.headers
|
||||
session_or_options.headers = None
|
||||
self._session = session_or_options
|
||||
self._session = copy(session_or_options)
|
||||
self._headers = self._session.headers
|
||||
self._session.headers = None
|
||||
|
||||
def _s_set_runtime_settings(self):
|
||||
"""设置运行时用到的属性"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user