Skip to main content

A client which calls remote web browser debugger methods

Project description

browser-debugger-tools

Build Status PyPI Python License

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for browserdebuggertools, version 5.1.0
Filename, size File type Python version Upload date Hashes
Filename, size browserdebuggertools-5.1.0-py2-none-any.whl (23.4 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size browserdebuggertools-5.1.0-py3-none-any.whl (23.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size browserdebuggertools-5.1.0.tar.gz (17.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page