Console

This domain is deprecated - use Runtime or Log instead.

Types

Generally, you do not need to instantiate CDP types yourself. Instead, the API creates objects for you as return values from commands, and then you can use those objects as arguments to other commands.

class cdp.console.ConsoleMessage(source, level, text, url=None, line=None, column=None)

Console message.

column = None

Column number in the resource that generated this message (1-based).

level = None

Message severity.

line = None

Line number in the resource that generated this message (1-based).

source = None

Message source.

text = None

Message text.

url = None

URL of the message origin.

Commands

Each command is a generator function. The return type Generator[x, y, z] indicates that the generator yields arguments of type x, it must be resumed with an argument of type y, and it returns type z. In this library, types x and y are the same for all commands, and z is the return type you should pay attention to. For more information, see Getting Started: Commands.

cdp.console.clear_messages()

Does nothing.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.console.disable()

Disables console domain, prevents further console messages from being reported to the client.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]
cdp.console.enable()

Enables console domain, sends the messages collected so far to the client by means of the messageAdded notification.

Return type:Generator[Dict[str, Any], Dict[str, Any], None]

Events

Generally, you do not need to instantiate CDP events yourself. Instead, the API creates events for you and then you use the event’s attributes.

class cdp.console.MessageAdded(message)

Issued when new console message is added.

message = None

Console message that has been added.