From 54661883ffbd8d086b0132ca595fb78d2a6dc89d Mon Sep 17 00:00:00 2001 From: mfrank Date: Sat, 18 Jan 2025 22:07:48 +0100 Subject: [PATCH] switched to chrome as browser --- main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 5fdb491..6fdb1b5 100644 --- a/main.py +++ b/main.py @@ -1,10 +1,11 @@ from selenium import webdriver +from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC from datetime import datetime, timedelta from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart -from selenium.webdriver.support.wait import WebDriverWait -from selenium.webdriver.firefox.options import Options import smtplib import time from dotenv import load_dotenv @@ -48,8 +49,11 @@ def check_date(due_date, recipient_email): def check_books(user, pw, recipient_email): options = Options() - options.add_argument("--headless") - driver = webdriver.Firefox(options=options) + options.add_argument("--headless") # Run Chrome in headless mode + options.add_argument("--disable-gpu") # Disable GPU acceleration + options.add_argument("--no-sandbox") # Required for some environments + driver = webdriver.Chrome(options=options) # Use ChromeDriver + try: # Navigate to the login page driver.get("https://webserver.sv-radebeul.de/Mediensuche-Konto/Mein-Konto")