From 28d065d4ffdbce8e12d4c22b3d524e2fb90f0e56 Mon Sep 17 00:00:00 2001 From: g1879 Date: Thu, 6 Aug 2020 23:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=88=B6=E7=B1=BBdownload?= =?UTF-8?q?=E5=87=BD=E6=95=B0=EF=BC=8Cd=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E5=85=88=E4=BC=A0=E9=80=92cookies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/mix_page.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/DrissionPage/mix_page.py b/DrissionPage/mix_page.py index 61d718a..b49a1b1 100644 --- a/DrissionPage/mix_page.py +++ b/DrissionPage/mix_page.py @@ -155,6 +155,17 @@ class MixPage(Null, SessionPage, DriverPage): self.change_mode('s', go=False) return super().post(url, data, go_anyway, **kwargs) + def download(self, + file_url: str, + goal_path: str = None, + rename: str = None, + file_exists: str = 'rename', + show_msg: bool = False, + **kwargs) -> tuple: + if self.mode == 'd': + self.cookies_to_session() + return super().download(file_url, goal_path, rename, file_exists, show_msg, **kwargs) + # ----------------重写DriverPage的函数----------------------- def chrome_downloading(self, download_path: str = None) -> list: