Skip to content

How to run a headless driver with user-data-dir and a running headful browser instance? #2640

Answered by mdmintz
KashitsynArtem asked this question in Q&A
Discussion options

You must be logged in to vote

Chrome has two types of headless modes (https://stackoverflow.com/a/73840130/7058266) which are triggered by:

options.add_argument("--headless") # The original headless mode
options.add_argument("--headless=new") # The newer headless mode

The original headless mode has limited functionality, but is a little faster.
The newer headless mode has the same functionality as regular Chrome.

In SeleniumBase, the original headless mode is triggered by --headless / headless=True.
In SeleniumBase, the newer headless mode is triggered by --headless2 / headless2=True.

Sometimes, the newer headless mode will be used automatically (even if specifying the original one) because some things such as UC Mode…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@KashitsynArtem
Comment options

@mdmintz
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants