Skip to content

协议基础类型

Chrome DevTools 协议命令、响应和事件的基础类型和结构。

基础类型

pydoll.protocol.base

T_CommandParams module-attribute

T_CommandParams = TypeVar('T_CommandParams')

T_CommandResponse module-attribute

T_CommandResponse = TypeVar('T_CommandResponse')

T_EventParams module-attribute

T_EventParams = TypeVar('T_EventParams')

EmptyParams

Bases: TypedDict

Empty parameters for commands.

EmptyResponse

Bases: TypedDict

Empty response for commands.

Command

Bases: TypedDict, Generic[T_CommandParams, T_CommandResponse]

Base structure for all commands.

ATTRIBUTE DESCRIPTION
method

The command method name

TYPE: str

params

Optional dictionary of parameters for the command

TYPE: NotRequired[T_CommandParams]

id instance-attribute
id
method instance-attribute
method
params instance-attribute
params

Response

Bases: TypedDict, Generic[T_CommandResponse]

Base structure for all responses.

ATTRIBUTE DESCRIPTION
id

The ID that matches the command ID

TYPE: int

result

The result data for the command

TYPE: T_CommandResponse

id instance-attribute
id
result instance-attribute
result

CDPEvent

Bases: TypedDict, Generic[T_EventParams]

Base structure for all events.

method instance-attribute
method
params instance-attribute
params