fix no attribute headless

This commit is contained in:
trueToastedCode 2023-11-03 13:44:36 +01:00
parent cea80717c5
commit 099412ee7b
1 changed files with 2 additions and 2 deletions

View File

@ -395,7 +395,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
if no_sandbox: if no_sandbox:
options.arguments.extend(["--no-sandbox", "--test-type"]) options.arguments.extend(["--no-sandbox", "--test-type"])
if headless or options.headless: if headless or (hasattr(options, 'headless') and options.headless):
#workaround until a better checking is found #workaround until a better checking is found
try: try:
if self.patcher.version_main < 108: if self.patcher.version_main < 108:
@ -485,7 +485,7 @@ class Chrome(selenium.webdriver.chrome.webdriver.WebDriver):
else: else:
self._web_element_cls = WebElement self._web_element_cls = WebElement
if options.headless: if hasattr(options, 'headless') and options.headless:
self._configure_headless() self._configure_headless()
def _configure_headless(self): def _configure_headless(self):