From 563f07796438e463e4aad221a0bdff307c03eae9 Mon Sep 17 00:00:00 2001 From: lyousan <2762027866@qq.com> Date: Tue, 23 Jul 2024 01:40:32 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96frame?= =?UTF-8?q?=E6=97=B6=E9=87=8D=E5=A4=8D=E5=88=9B=E5=BB=BAdriver=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=BA=BF=E7=A8=8B=E7=88=86=E7=82=B8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DrissionPage/_base/browser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DrissionPage/_base/browser.py b/DrissionPage/_base/browser.py index b01aec3..997a7ea 100644 --- a/DrissionPage/_base/browser.py +++ b/DrissionPage/_base/browser.py @@ -457,9 +457,10 @@ class Chromium(object): :param owner: 使用该驱动的对象 :return: Driver对象 """ - d = self._drivers.pop(tab_id, None) + d = self._drivers.get(tab_id, None) if not d: d = Driver(tab_id, 'page', self.address) + self._drivers[tab_id] = d d.owner = owner self._all_drivers.setdefault(tab_id, set()).add(d) return d