ChromiumOptions
Configures the browser before launch: the binary path, headless mode, command-line flags, and preferences. Learn more in Browser options.
pydoll.browser.options.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
Gets the list of command-line arguments.
| RETURNS | DESCRIPTION |
|---|---|
list
|
A list of command-line arguments added to the options.
TYPE:
|
binary_location
property
writable
Gets the location of the browser binary.
| RETURNS | DESCRIPTION |
|---|---|
str
|
The file path to the browser executable.
TYPE:
|
start_timeout
property
writable
Gets the timeout to verify the browser's running state.
| RETURNS | DESCRIPTION |
|---|---|
int
|
The timeout in seconds.
TYPE:
|
max_message_size
property
writable
Gets the largest CDP message, in bytes, a connection accepts.
A page controls the size of some CDP messages (a POST body in
Network.requestWillBeSent or Fetch.requestPaused, a WebSocket
frame), so the limit applies to every connection Pydoll opens: the
browser's, each tab's and each iframe's. A larger message closes that
connection, and the commands waiting on it raise
WebSocketConnectionClosed. The next command opens a new connection.
| RETURNS | DESCRIPTION |
|---|---|
int | None
|
int | None: The limit in bytes (256 MiB by default), or None for no limit. |
add_argument
Adds a command-line argument to the options.
| PARAMETER | DESCRIPTION |
|---|---|
argument
|
The command-line argument to be added.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ArgumentAlreadyExistsInOptions
|
If the argument is already in the list of arguments. |
remove_argument
Removes a command-line argument from the options.
| PARAMETER | DESCRIPTION |
|---|---|
argument
|
The command-line argument to be removed.
TYPE:
|
| RAISES | DESCRIPTION |
|---|---|
ArgumentNotFoundInOptions
|
If the argument is not in the list of arguments. |
set_default_download_directory
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:
|