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.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b4e3392c08e3fd77180b11a85249abafad9c897327958306edcae507af1ec22 |
|
MD5 | 8f7a30ff9544a168d168c45fd0dc3638 |
|
BLAKE2b-256 | 7f64396a32c6a1bd0bbc4f24326170617c3613e1ba353460b01790f8b93c7587 |
Hashes for browserdebuggertools-6.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2e8ae6d170f800a554403a9b6c1c7438e75369018ceecb2e3852fd380649b5 |
|
MD5 | fbe98e8de1a5c0754228adb96782f82b |
|
BLAKE2b-256 | d82b8d4127c24a2da8284e3b2aabe6581297be45f245923a07899ad74d0948f1 |