From 37215107e9bf286fac3aca88ac61dc5454c049cc Mon Sep 17 00:00:00 2001 From: ilike2burnthing <59480337+ilike2burnthing@users.noreply.github.com> Date: Mon, 29 Jul 2024 21:00:40 +0100 Subject: [PATCH] Update sessions.py --- src/sessions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sessions.py b/src/sessions.py index 30bb3c1..7fb39d3 100644 --- a/src/sessions.py +++ b/src/sessions.py @@ -4,7 +4,7 @@ from datetime import datetime, timedelta from typing import Optional, Tuple from uuid import uuid1 -from selenium.webdriver.chrome.webdriver import WebDriver +from DrissionPage import ChromiumPage import utils @@ -12,7 +12,7 @@ import utils @dataclass class Session: session_id: str - driver: WebDriver + driver: ChromiumPage created_at: datetime def lifetime(self) -> timedelta: @@ -27,13 +27,13 @@ class SessionsStorage: def create(self, session_id: Optional[str] = None, proxy: Optional[dict] = None, force_new: Optional[bool] = False) -> Tuple[Session, bool]: - """create creates new instance of WebDriver if necessary, + """create creates new instance of ChromiumPage if necessary, assign defined (or newly generated) session_id to the instance and returns the session object. If a new session has been created second argument is set to True. Note: The function is idempotent, so in case if session_id - already exists in the storage a new instance of WebDriver won't be created + already exists in the storage a new instance of ChromiumPage won't be created and existing session will be returned. Second argument defines if new session has been created (True) or an existing one was used (False). """