pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/scivisum/browser-debugger-tools

in="anonymous" media="all" rel="stylesheet" href="https://github.githubassets.com/assets/repository-3aa75d4cd2374bb7.css" /> GitHub - scivisum/browser-debugger-tools: A python client for the devtools protocol · GitHub
Skip to content

Repository files navigation

browser-debugger-tools

CirclCI 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.

>> devtools_client = ChromeInterface(9899, domains={"Page": {}})

The client provides some devtools interface methods, for example:

>> with devtools_client.set_timeout(10):
   ... 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

>> devtools_client.execute(domain="Network", method="enable")
>> devtools_client.execute("Network", "setUserAgentOverride", {"userAgent": "Test"})

Contributing

Running Tests

The test.sh script makes running tests easier, it will create containers with the required environment; and run a virtual display for the E2E tests.

It takes a single argument which is a pytest expression to run a subset of tests, for example:

./test.sh e2etests/chrome/test_interface.py::TestSwitchTabHeaded::test_switch_tab_headed

About

A python client for the devtools protocol

Topics

Resources

Stars

17 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy