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="Network", method="enable")
>> self.devtools_client.execute("Network", "setUserAgentOverride", {"userAgent": "Test"})
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 Distribution
Hashes for browserdebuggertools-6.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6bbbf4b2eef310e82d3518e3aee33c6a9f7388894df7845e6dfbe6b451a238e |
|
MD5 | de6e260edb9b985a81a5eeef14d57d63 |
|
BLAKE2b-256 | 98ff43e757da22e2c402c7c078f2ea6ccc084230e01a3fe31e74c3ab1c290a8d |
Hashes for browserdebuggertools-6.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54fb0d73676509b983fc559f072ff13b4dd3515d9d0166cea335e9e2839279c8 |
|
MD5 | 8b11130f7619ba3c61d72f017d638f02 |
|
BLAKE2b-256 | c8eda36bef466ed45e52d4aa7e7641cf385a088d53fad1cf38a58d9067782060 |