manen.resource.chrome#

class manen.resource.chrome.application[source]

Bases: object

BINARIES = {'Darwin': '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome', 'Linux': 'google-chrome'}
classmethod installed_version() Version[source]

Get the version of the installed application, as a tuple.

Raises:

ManenException – raised in 4 possible cases: - the browser is not installed - manen doesn’t know the shell command to find the version of Chrome - an error is returned by the shell command used to get the version - a version could not be inferred from the output of the shell command

Returns:

Version of the browser installed, as a tuple

Return type:

Tuple[int]

classmethod is_installed() bool[source]

Check if the application is installed locally.

Returns:

Whether or not the browser is installed.

Return type:

bool

static list_versions(os: str = 'Linux') List[InstalledVersionInfo][source]

List all the versions available online for the browser.

Parameters:

os (str, optional) – OS to check by. Defaults to PLATFORM.system.

Returns:

A list of dictionaries with the following keys:
  • version

  • release_date

  • os

  • channel

Return type:

List[InstalledVersionInfo]

class manen.resource.chrome.driver[source]

Bases: object

A set of functions used to manage the Chrome drivers. It can be used, for instance, to list all existing versions of Chromedriver and then download one of the available versions.

CHROMEDRIVER_API = 'https://chromedriver.storage.googleapis.com/'
classmethod download(version: str | Version = 'installed', platform_system: str = 'Linux', unzip: bool = True, remove_archive: bool = True) str[source]

Given a specific Chrome version, download the matching driver from the official Chrome driver storage.

Parameters:
  • version (str, Tuple[int]) – Default to the current installed version.

  • os (str) – Default to PLATFORM.system.

  • unzip (bool) – Default to True.

  • remove_archive (bool) – Default to True.

Returns:

Path of the downloaded driver

Return type:

str

classmethod get(query: str = 'installed', platform_system: str = 'Linux', download_if_missing: bool = True) str[source]
classmethod latest_release(version='installed') Version[source]
classmethod list_versions(query: str | None = None, platform_system: str = 'Linux')[source]