Fix browse_website headless mode for Firefox (#2816)

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
This commit is contained in:
Irmius
2023-04-27 20:32:31 +03:00
committed by GitHub
parent 3d89ed1787
commit 6b4ad1f933
2 changed files with 8 additions and 1 deletions

View File

@@ -78,6 +78,9 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]:
)
if CFG.selenium_web_browser == "firefox":
if CFG.selenium_headless:
options.headless = True
options.add_argument("--disable-gpu")
driver = webdriver.Firefox(
executable_path=GeckoDriverManager().install(), options=options
)
@@ -92,7 +95,7 @@ def scrape_text_with_selenium(url: str) -> tuple[WebDriver, str]:
options.add_argument("--no-sandbox")
if CFG.selenium_headless:
options.add_argument("--headless")
options.add_argument("--headless=new")
options.add_argument("--disable-gpu")
chromium_driver_path = Path("/usr/bin/chromedriver")