Skip to content

Commit

Permalink
Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SenZmaKi committed Jun 29, 2024
1 parent 1d05dda commit 742e937
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions senpwai/common/selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from selenium.webdriver import (
Chrome,
ChromeOptions,
ChromeService,
Edge,
EdgeOptions,
EdgeService,
Expand All @@ -23,6 +22,7 @@
)
from selenium.common.exceptions import NoSuchDriverException
from selenium.webdriver.chromium.options import ChromiumOptions
from selenium.webdriver.chromium.service import ChromiumService
from selenium.webdriver.common.options import ArgOptions
import os

Expand Down Expand Up @@ -65,6 +65,7 @@ def setup_options(options: ArgOptions):
options.add_argument("--disable-extensions")
options.add_argument("--disable-infobars")
options.add_argument("--no-sandbox")
options.add_argument("--disable-dev-shm-usage")
# Doesn't work for some reason reference HACK:
# options.add_argument("--log-level=3")
if isinstance(options, FirefoxOptions):
Expand All @@ -76,8 +77,6 @@ def setup_options(options: ArgOptions):
chrome_path = os.getenv("CHROME_PATH", None)
print("Chrome path:", chrome_path)
options.binary_location = chrome_path
pass
else:
if headless:
options.add_argument("--headless=new")
return options
Expand All @@ -92,7 +91,7 @@ def helper(browser_name: BrowserName):
case BrowserName.chrome:
chrome_driver_path = os.getenv("CHROME_DRIVER_PATH", None)
print("Chrome driver path:", chrome_driver_path)
service_chrome = ChromeService(
service_chrome = ChromiumService(
executable_path=chrome_driver_path
)
options = cast(ChromeOptions, setup_options(ChromeOptions()))
Expand Down

0 comments on commit 742e937

Please sign in to comment.