|
|
|
@ -1,3 +1,5 @@
@@ -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):
@@ -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: |
|
|
|
|