From c320028f15059464e6861df1bd763571615e12d5 Mon Sep 17 00:00:00 2001 From: g1879 Date: Wed, 17 Jul 2024 00:00:49 +0800 Subject: [PATCH] =?UTF-8?q?4.1.0.0b8=E4=BF=AE=E5=A4=8D=E5=B0=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/__init__.py | 2 +- DrissionPage/_functions/web.py | 3 ++- DrissionPage/_pages/mix_page.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DrissionPage/__init__.py b/DrissionPage/__init__.py index f97d719..b292279 100644 --- a/DrissionPage/__init__.py +++ b/DrissionPage/__init__.py @@ -14,4 +14,4 @@ from ._pages.chromium_page import ChromiumPage from ._pages.mix_page import MixPage from ._pages.mix_page import MixPage as WebPage -__version__ = '4.1.0.0b7' +__version__ = '4.1.0.0b8' diff --git a/DrissionPage/_functions/web.py b/DrissionPage/_functions/web.py index bebe132..f86605e 100644 --- a/DrissionPage/_functions/web.py +++ b/DrissionPage/_functions/web.py @@ -12,6 +12,7 @@ from re import sub from urllib.parse import urlparse, urljoin, urlunparse from DataRecorder.tools import make_valid_name +from requests.structures import CaseInsensitiveDict def get_ele_txt(e): @@ -369,7 +370,7 @@ def format_headers(txt): :param txt: 从浏览器复制的原始文本格式headers :return: dict格式headers """ - if isinstance(txt, dict): + if isinstance(txt, (dict, CaseInsensitiveDict)): for k, v in txt.items(): txt[k] = str(v) return txt diff --git a/DrissionPage/_pages/mix_page.py b/DrissionPage/_pages/mix_page.py index 0afbaed..e4e834c 100644 --- a/DrissionPage/_pages/mix_page.py +++ b/DrissionPage/_pages/mix_page.py @@ -147,7 +147,7 @@ class MixPage(SessionPage, ChromiumPage, BasePage): @property def timeout(self): """返回通用timeout设置""" - return super()._timeout if self._mode == 's' else self.timeouts.base + return self._timeout if self._mode == 's' else self.timeouts.base def get(self, url, show_errmsg=False, retry=None, interval=None, timeout=None, **kwargs): """跳转到一个url