Skip to content

Browser Options

ChromiumOptions

pydoll.browser.options.ChromiumOptions

ChromiumOptions()

Bases: Options

A class to manage command-line options for a browser instance.

This class allows the user to specify command-line arguments and the binary location of the browser executable.

Initializes the Options instance.

Sets up an empty list for command-line arguments and a string for the binary location of the browser.

arguments property writable

arguments

Gets the list of command-line arguments.

RETURNS DESCRIPTION
list

A list of command-line arguments added to the options.

TYPE: list[str]

binary_location property writable

binary_location

Gets the location of the browser binary.

RETURNS DESCRIPTION
str

The file path to the browser executable.

TYPE: str

start_timeout property writable

start_timeout

Gets the timeout to verify the browser's running state.

RETURNS DESCRIPTION
int

The timeout in seconds.

TYPE: int

browser_preferences property writable

browser_preferences

prompt_for_download property writable

prompt_for_download

block_popups property writable

block_popups

password_manager_enabled property writable

password_manager_enabled

block_notifications property writable

block_notifications

allow_automatic_downloads property writable

allow_automatic_downloads

open_pdf_externally property writable

open_pdf_externally

headless property writable

headless

add_argument

add_argument(argument)

Adds a command-line argument to the options.

PARAMETER DESCRIPTION
argument

The command-line argument to be added.

TYPE: str

RAISES DESCRIPTION
ArgumentAlreadyExistsInOptions

If the argument is already in the list of arguments.

remove_argument

remove_argument(argument)

Removes a command-line argument from the options.

PARAMETER DESCRIPTION
argument

The command-line argument to be removed.

TYPE: str

RAISES DESCRIPTION
ArgumentNotFoundInOptions

If the argument is not in the list of arguments.

set_default_download_directory

set_default_download_directory(path)

Set the default directory where downloaded files will be saved.

Usage: Sets the 'download.default_directory' preference for Chrome.

PARAMETER DESCRIPTION
path

Absolute path to the download destination folder.

TYPE: str

set_accept_languages

set_accept_languages(languages)

Set the accepted languages for the browser.

Usage: Sets the 'intl.accept_languages' preference.

PARAMETER DESCRIPTION
languages

A comma-separated string of language codes (e.g., 'pt-BR,pt,en-US,en').

TYPE: str

Options Interface

pydoll.browser.interfaces.Options

Bases: ABC

arguments abstractmethod property

arguments

binary_location abstractmethod property

binary_location

start_timeout abstractmethod property

start_timeout

browser_preferences abstractmethod property

browser_preferences

headless abstractmethod property writable

headless

add_argument abstractmethod

add_argument(argument)

BrowserOptionsManager Interface

pydoll.browser.interfaces.BrowserOptionsManager

Bases: ABC

initialize_options abstractmethod

initialize_options()

add_default_arguments abstractmethod

add_default_arguments()