added no-sandbox switch if run by root, added no-first-run if chrome was never used before

This commit is contained in:
Pakobbix 2023-03-19 22:14:09 +01:00
parent 84b139f403
commit 6659c870b8

View File

@ -49,8 +49,10 @@ chrome_options = webdriver.ChromeOptions()
# Verhindert das der Chromedriver log angezeigt wird.
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
chrome_options.binary_location = chrome_binary
chrome_options.add_argument('--no-first-run')
chrome_options.add_argument('--no-sandbox')
# Öffnet den Chrome im Headless modus (Ohne Fenster)
#chrome_options.add_argument('--headless')
chrome_options.add_argument('--headless')
# Erstelle eine Session mit Chrome und den vorher definierten Einstellungen
driver = webdriver.Chrome(options=chrome_options)
@ -176,3 +178,5 @@ except TimeoutException:
except TimeoutException:
print("The 'Open Lucky Pot' button was not found within 10 seconds. Exiting...")
driver.quit()