Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attribute error of options.headless #1602

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions undetected_chromedriver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def __init__(

if any([_ in arg for _ in ("--headless", "headless")]):
options.arguments.remove(arg)
options.headless = True
headless = True

if "lang" in arg:
m = re.search("(?:--)?lang(?:[ =])?(.*)", arg)
Expand Down Expand Up @@ -395,7 +395,7 @@ def __init__(
if no_sandbox:
options.arguments.extend(["--no-sandbox", "--test-type"])

if headless or options.headless:
if headless:
#workaround until a better checking is found
try:
if self.patcher.version_main < 108:
Expand Down Expand Up @@ -485,7 +485,7 @@ def __init__(
else:
self._web_element_cls = WebElement

if options.headless:
if headless:
self._configure_headless()

def _configure_headless(self):
Expand Down