Config

class splinter.config.Config(extensions: List[str] | None = None, fullscreen: bool | None = False, headless: bool | None = False, incognito: bool | None = False, user_agent: str | None = None)

Standard interface for basic and nearly universal driver flags.

The primary purpose of Config is to reduce the burden on the user to import Selenium Options objects for common operations. The second purpose is to avoid argument bloat and drift for the various drivers.

Both Splinter Config and Selenium Options can be used together. Config will override Options, if applicable.

Config is not a complete replacement for Selenium Options. For unique and esoteric functionality that is exclusive to one web browser, Selenium Options should still be used. The purpose of Config is to expose a universal interface for common functionality, not try to capture all of it.

Example

>>> from splinter import Browser, Config
>>>
>>>
>>> my_config = Config(fullscreen=True)
>>> my_browser = Browser(config=my_config)
extensions

Add extensions to the browser. The full path to each extension must be included. When the browser is closed extensions will be deleted from the profile, even if the profile is not a temporary one.

Type:

List[str] | None

fullscreen

Launch the browser in fullscreen mode.

Type:

bool | None

headless

Launch the browser in headless mode. Requires Chrome 59+ or Firefox 55+.

Type:

bool | None

incognito

Launch the browser in incognito mode.

Type:

bool | None

user_agent

Set a custom user_agent.

Type:

str | None