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: