From 8b598bfad407c9c772d9e915b902f06ba4ac2a5a Mon Sep 17 00:00:00 2001 From: g1879 Date: Tue, 6 Jun 2023 17:36:34 +0800 Subject: [PATCH] =?UTF-8?q?get()=E6=94=AF=E6=8C=81ipv6=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=EF=BC=9BSessionPage=E8=AE=BE=E7=BD=AE=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=97=B6=E4=B8=8D=E5=86=8D=E8=87=AA=E5=8A=A8=E5=88=A0=E9=99=A4?= =?UTF-8?q?http://?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/base.py | 2 +- DrissionPage/configs/session_options.py | 10 ---------- DrissionPage/network_listener.py | 5 +---- DrissionPage/network_listener.pyi | 2 -- DrissionPage/session_page.py | 10 ---------- 5 files changed, 2 insertions(+), 27 deletions(-) diff --git a/DrissionPage/base.py b/DrissionPage/base.py index aa2317b..8c5fd41 100644 --- a/DrissionPage/base.py +++ b/DrissionPage/base.py @@ -387,7 +387,7 @@ class BasePage(BaseParser): :param interval: 重试间隔 :return: 重试次数和间隔组成的tuple """ - self._url = quote(url, safe='/:&?=%;#@+!') + self._url = quote(url, safe='/:&?=%;#@+![]') retry = retry if retry is not None else self.retry_times interval = interval if interval is not None else self.retry_interval return retry, interval diff --git a/DrissionPage/configs/session_options.py b/DrissionPage/configs/session_options.py index 8e32598..cb83a54 100644 --- a/DrissionPage/configs/session_options.py +++ b/DrissionPage/configs/session_options.py @@ -116,16 +116,6 @@ class SessionOptions(object): :param https: https代理地址 :return: 返回当前对象 """ - if isinstance(http, str): - if http.startswith('http://'): - http = http[7:] - elif http.startswith('https://'): - http = http[8:] - if isinstance(https, str): - if https.startswith('http://'): - https = https[7:] - elif http.startswith('https://'): - https = https[8:] self._sets('proxies', {'http': http, 'https': https}) return self diff --git a/DrissionPage/network_listener.py b/DrissionPage/network_listener.py index ccbf43e..92f473b 100644 --- a/DrissionPage/network_listener.py +++ b/DrissionPage/network_listener.py @@ -87,10 +87,7 @@ class NetworkListener(object): self._set_callback_func() - if asyn: - self._total_count = count - else: - self._total_count = len(self._targets) if not count else count + self._total_count = len(self._targets) if not count else count Thread(target=self._wait_to_stop).start() diff --git a/DrissionPage/network_listener.pyi b/DrissionPage/network_listener.pyi index d0b7bf0..759f7b2 100644 --- a/DrissionPage/network_listener.pyi +++ b/DrissionPage/network_listener.pyi @@ -26,8 +26,6 @@ class NetworkListener(object): def set_targets(self, targets: Union[str, list, tuple, set, None] = None, is_regex: bool = False, count: int = None, method: Union[str, list, tuple, set] = None) -> None: ... - def start(self) -> None: ... - def stop(self) -> None: ... @property diff --git a/DrissionPage/session_page.py b/DrissionPage/session_page.py index 71ccb88..9d296bb 100644 --- a/DrissionPage/session_page.py +++ b/DrissionPage/session_page.py @@ -372,16 +372,6 @@ class SessionPageSetter(object): :param https: https代理地址 :return: None """ - if isinstance(http, str): - if http.startswith('http://'): - http = http[7:] - elif http.startswith('https://'): - http = http[8:] - if isinstance(https, str): - if https.startswith('http://'): - https = https[7:] - elif https.startswith('https://'): - https = https[8:] self._page.session.proxies = {'http': http, 'https': https} def auth(self, auth):