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 Pydocs. Note that this will only work with Selenium 2.17 onwards.
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()