Python Browsermob Proxy Library
This is the Python Library for interaction with the Browsermob Proxy. It allows us to create a proxy, set references and generate HAR representations. For more details read the docs. Note that this will only work with Selenium 2.17 onwards.
Example
from browsermobproxy import Server
server = Server("path/to/browsermob-proxy")
server.start()
proxy = server.create_proxy()
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.set_proxy(proxy.selenium_proxy())
driver = webdriver.Firefox(firefox_profile=profile)
proxy.new_har("google")
driver.get("http://www.google.co.uk")
proxy.har # returns a HAR JSON blob
proxy.stop()
driver.quit()
Releases
0.7.0
- Updating travis ci to use browsermob proxy 2.0
- Support to use httpsProxy and httpProxy at proxy creation time
- Adding Python 3 support
- add sslProxy to Client.add_to_capabilities with tests
- Correct docstring for `wait_for_traffic_to_stop`
- Removing unused :Args: items
- Updating docstrings
- Correcting args and params for documentation
- updated docstrings for easier formatting on things like RTDs
- updated new_har() docstrings
- updated client documentation
- Added client and server docs
- updating version in docs
0.6.0
- Added support for parameters in har creation
- Bug fixes for tests that are out of date
- Setup server constructor to look on path for location of browsermob-proxy executable. As well as looking for a file. Also added example code for using browsermob-proxy with chrome
- Fix project name
- adding docs
0.5.0
- Allow proxying of ssl requests with selenium.
- Updating case for proxy type
0.4.0
- Allow setting basic authentication
- Adding the ability to remap hosts which is available from BrowserMob Proxy Beta 7
- Merge pull request #6 from lukeis/patch-2
- Update readme.md
- initial commit of event listener to auto do record
- server.create_proxy is a function, should be called :)
- forgot to add the port
0.2.0
- DELETE /proxy/:port/
- /proxy/:port/limits
- /proxy/:port/blacklist
- /proxy/:port/whitelist
- fixing /proxy/:port/har/pageRef
- fixing /proxy/:port/har/pageRef
- fixing passing in a page ref as the name for the page in /proxy/:port/har
- tests around /proxy/:port/har and some cleanup of the implementation
- make /proxy/:port/headers work
- wrapping selenium_proxy with webdriver_proxy since the project is more than just webdriver
- extending the client to play nice with remote webdriver instances
- create_proxy sounds and feels like a method to me, let's make it so
- ensure the self.process exist, to reduce possibilities of AttributeError
- check the path before attempting to start the server
- wait longer than 3 seconds for the server to come up
0.1.0
- Remove HTTPLib2 and replace with Requests
- Added support for setting headers in the proxy
0.0.1