A client which calls remote web browser debugger methods
Project description
browser-debugger-tools
Overview
The purpose is to provide a python client to connect to the debugger tools of a web-browser.
Currently supports connecting to Google-Chrome/Chromium over the devtools protocol, via a wrapped websockets client. Feel free to extend and add support for other browsers as required.
For improved performance, install the wsaccel python lib https://pypi.org/project/wsaccel/
Example Usage
Start Google-Chrome, passing a remote debugger port argument, for example on Ubuntu:
$ google-chrome-stable --remote-debugging-port=9899
In a python console, you can connect to the remote debugging port and enable the Page domain.
>> self.devtools_client = ChromeInterface(9899, domains=["Page"])
The client provides some devtools interface methods, for example:
>> with self.devtools_client.set_timeout(10):
... self.devtools_client.take_screenshot("/tmp/screenshot.png")
Or more generally you can call remote methods according to the devtools protocol spec (https://chromedevtools.github.io/devtools-protocol/tot/Network), for example
>> self.devtools_client.execute(domain="Emulation", method="enable")
>> self.devtools_client.execute("Emulation", "setGeolocationOverride", args={"latitude": 20, "longitude": 35})
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for browserdebuggertools-5.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c3bd8149673830f10caae91be8e390c2bdd25c00a962db1b81643bad5ed8c52 |
|
MD5 | 4bcf5fb3b096fb9077a98220f8a34723 |
|
BLAKE2b-256 | 24f18fc0a1820aa75bd8a78a56d686af56e240d90765c46f7bf55cf5535c7f0e |
Hashes for browserdebuggertools-5.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13c21b285fccea5068a2392c3cebcfc1431ab0bb929b70018132090817a64854 |
|
MD5 | 5f14fffd0532b293d7aa6cf2c7ff5895 |
|
BLAKE2b-256 | 5f59c7def8a165daaa189fd200e3325bfa76884088b242e271299e2abd66c621 |
Hashes for browserdebuggertools-5.3.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9bb4ec7f0d302b5df3357d43b5a41946329e6ba131fd8e6c9854aeda12fa4d2c |
|
MD5 | 59109003e21509efb9baa767a0bdfb3c |
|
BLAKE2b-256 | c6ece319087c25c03be38b3bd284c816aedc449913de37ca621aed9155872f12 |