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