| |
- __builtin__.object
-
- DevToolsHttp
- telemetry.core.exceptions.Error(exceptions.Exception)
-
- DevToolsClientConnectionError
-
- DevToolsClientUrlError
class DevToolsHttp(__builtin__.object) |
|
A helper class to send and parse DevTools HTTP requests.
This class maintains a persistent http connection to Chrome devtools.
Ideally, owners of instances of this class should call Disconnect() before
disposing of the instance. Otherwise, the connection will not be closed until
the instance is garbage collected. |
|
Methods defined here:
- Disconnect(self)
- Closes the HTTP connection.
- Request(self, path, timeout=30)
- Sends a request to Chrome devtools.
This method lazily creates an HTTP connection, if one does not already
exist.
Args:
path: The DevTools URL path, without the /json/ prefix.
timeout: Timeout defaults to 30 seconds.
Raises:
DevToolsClientConnectionError: If the connection fails.
- RequestJson(self, path, timeout=30)
- Sends a request and parse the response as JSON.
Args:
path: The DevTools URL path, without the /json/ prefix.
timeout: Timeout defaults to 30 seconds.
Raises:
DevToolsClientConnectionError: If the connection fails.
ValueError: If the response is not a valid JSON.
- __del__(self)
- __init__(self, devtools_port)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |