selenium.webdriver.common.bidi.storage

Classes

BrowsingContextPartitionDescriptor(context)

Represents a browsing context partition descriptor.

BytesValue(type, value)

Represents a bytes value.

Cookie(name, value, domain[, path, size, ...])

Represents a cookie.

CookieFilter([name, value, domain, path, ...])

Represents a filter for cookies.

DeleteCookiesResult(partition_key)

Represents the result of a deleteCookies command.

GetCookiesResult(cookies, partition_key)

Represents the result of a getCookies command.

PartialCookie(name, value, domain[, path, ...])

Represents a partial cookie for setting.

PartitionKey([user_context, source_origin])

Represents a storage partition key.

SameSite()

Represents the possible same site values for cookies.

SetCookieResult(partition_key)

Represents the result of a setCookie command.

Storage(conn)

BiDi implementation of the storage module.

StorageKeyPartitionDescriptor([...])

Represents a storage key partition descriptor.

class selenium.webdriver.common.bidi.storage.SameSite[source]

Represents the possible same site values for cookies.

STRICT = 'strict'
LAX = 'lax'
NONE = 'none'
class selenium.webdriver.common.bidi.storage.BytesValue(type: str, value: str)[source]

Represents a bytes value.

TYPE_BASE64 = 'base64'
TYPE_STRING = 'string'
to_dict() Dict[source]

Converts the BytesValue to a dictionary.

Returns:

Dict: A dictionary representation of the BytesValue.

class selenium.webdriver.common.bidi.storage.Cookie(name: str, value: BytesValue, domain: str, path: str | None = None, size: int | None = None, http_only: bool | None = None, secure: bool | None = None, same_site: str | None = None, expiry: int | None = None)[source]

Represents a cookie.

classmethod from_dict(data: Dict) Cookie[source]

Creates a Cookie instance from a dictionary.

Parameters:

data: A dictionary containing the cookie information.

Returns:

Cookie: A new instance of Cookie.

class selenium.webdriver.common.bidi.storage.CookieFilter(name: str | None = None, value: BytesValue | None = None, domain: str | None = None, path: str | None = None, size: int | None = None, http_only: bool | None = None, secure: bool | None = None, same_site: str | None = None, expiry: int | None = None)[source]

Represents a filter for cookies.

to_dict() Dict[source]

Converts the CookieFilter to a dictionary.

Returns:

Dict: A dictionary representation of the CookieFilter.

class selenium.webdriver.common.bidi.storage.PartitionKey(user_context: str | None = None, source_origin: str | None = None)[source]

Represents a storage partition key.

classmethod from_dict(data: Dict) PartitionKey[source]

Creates a PartitionKey instance from a dictionary.

Parameters:

data: A dictionary containing the partition key information.

Returns:

PartitionKey: A new instance of PartitionKey.

class selenium.webdriver.common.bidi.storage.BrowsingContextPartitionDescriptor(context: str)[source]

Represents a browsing context partition descriptor.

to_dict() Dict[source]

Converts the BrowsingContextPartitionDescriptor to a dictionary.

Returns:

Dict: A dictionary representation of the BrowsingContextPartitionDescriptor.

class selenium.webdriver.common.bidi.storage.StorageKeyPartitionDescriptor(user_context: str | None = None, source_origin: str | None = None)[source]

Represents a storage key partition descriptor.

to_dict() Dict[source]

Converts the StorageKeyPartitionDescriptor to a dictionary.

Returns:

Dict: A dictionary representation of the StorageKeyPartitionDescriptor.

class selenium.webdriver.common.bidi.storage.PartialCookie(name: str, value: BytesValue, domain: str, path: str | None = None, http_only: bool | None = None, secure: bool | None = None, same_site: str | None = None, expiry: int | None = None)[source]

Represents a partial cookie for setting.

to_dict() Dict[source]

Converts the PartialCookie to a dictionary.

Returns:

Dict: A dictionary representation of the PartialCookie.

class selenium.webdriver.common.bidi.storage.GetCookiesResult(cookies: List[Cookie], partition_key: PartitionKey)[source]

Represents the result of a getCookies command.

classmethod from_dict(data: Dict) GetCookiesResult[source]

Creates a GetCookiesResult instance from a dictionary.

Parameters:

data: A dictionary containing the get cookies result information.

Returns:

GetCookiesResult: A new instance of GetCookiesResult.

class selenium.webdriver.common.bidi.storage.SetCookieResult(partition_key: PartitionKey)[source]

Represents the result of a setCookie command.

classmethod from_dict(data: Dict) SetCookieResult[source]

Creates a SetCookieResult instance from a dictionary.

Parameters:

data: A dictionary containing the set cookie result information.

Returns:

SetCookieResult: A new instance of SetCookieResult.

class selenium.webdriver.common.bidi.storage.DeleteCookiesResult(partition_key: PartitionKey)[source]

Represents the result of a deleteCookies command.

classmethod from_dict(data: Dict) DeleteCookiesResult[source]

Creates a DeleteCookiesResult instance from a dictionary.

Parameters:

data: A dictionary containing the delete cookies result information.

Returns:

DeleteCookiesResult: A new instance of DeleteCookiesResult.

class selenium.webdriver.common.bidi.storage.Storage(conn)[source]

BiDi implementation of the storage module.

get_cookies(filter: CookieFilter | None = None, partition: BrowsingContextPartitionDescriptor | StorageKeyPartitionDescriptor | None = None) GetCookiesResult[source]

Retrieves cookies that match the given parameters.

Parameters:

filter: Optional filter to match cookies. partition: Optional partition descriptor.

Returns:

GetCookiesResult: The result of the get cookies command.

Sets a cookie in the browser.

Parameters:

cookie: The cookie to set. partition: Optional partition descriptor.

Returns:

SetCookieResult: The result of the set cookie command.

delete_cookies(filter: CookieFilter | None = None, partition: BrowsingContextPartitionDescriptor | StorageKeyPartitionDescriptor | None = None) DeleteCookiesResult[source]

Deletes cookies that match the given parameters.

Parameters:

filter: Optional filter to match cookies to delete. partition: Optional partition descriptor.

Returns:

DeleteCookiesResult: The result of the delete cookies command.