From 7f7aead83dbcce0fae245b245c37ff8078846729 Mon Sep 17 00:00:00 2001 From: mfrank Date: Sat, 18 Jan 2025 22:13:15 +0100 Subject: [PATCH] added private mode and adjusted user dir --- main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.py b/main.py index c5fdfb0..74aedb3 100644 --- a/main.py +++ b/main.py @@ -1,3 +1,5 @@ +import tempfile + from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By @@ -53,6 +55,10 @@ def check_books(user, pw, recipient_email): options.add_argument("--disable-gpu") # Disable GPU acceleration options.add_argument("--no-sandbox") # Required for some environments options.add_argument("--incognito") + # Use a unique temporary user-data-dir + temp_dir = tempfile.mkdtemp() + options.add_argument(f"--user-data-dir={temp_dir}") + driver = webdriver.Chrome(options=options) # Use ChromeDriver try: