Skip to content
Branch: master
Go to file

Latest commit

AutomatedTester committed 48accb7 May 23, 2018
specify host as option with localhost as default


Failed to load latest commit information.
Latest commit message
Commit time


Python client for the BrowserMob Proxy 2.0 REST API.

How to use with selenium-webdriver


from browsermobproxy import Server
server = Server("path/to/browsermob-proxy")
proxy = server.create_proxy()

from selenium import webdriver
profile  = webdriver.FirefoxProfile()
driver = webdriver.Firefox(firefox_profile=profile)

proxy.har # returns a HAR JSON blob


for Chrome use

chrome_options = webdriver.ChromeOptions()
browser = webdriver.Chrome(chrome_options = chrome_options)

Running Tests

Install pytest if you don't have it already.

$ pip install pytest

Start a browsermob instance.

$ java -jar browsermob.jar --port 9090

In a separate window:

$ py.test

If you are going to watch the test, the 'human' ones should display an english muffin instead of the american flag on the 'pick your version' page. Or at least it does from Canada.

To run the tests in a CI environment, disable the ones that require human judgement by adding "-m "not human" test" to the py.test command.

$ py.test -m "not human" test

See also

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Send me a pull request. Bonus points for topic branches.


Copyright 2011 David Burns

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

You can’t perform that action at this time.