Hello, I'm new to Python and I'm trying to use Python with Browsermob-proxy. I've taken the example code from
from browsermobproxy import Server
server = Server("/home/browsermob/browsermob/bin/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")
proxy.har # returns a HAR JSON blob
server.stop()
driver.quit()
When I run this, I get the following error:
Traceback (most recent call last):
File "webtest.py", line 10, in <module>
profile.set_proxy(proxy.selenium_proxy())
AttributeError: 'function' object has no attribute 'selenium_proxy'
The environment is CentOS 6.2 with system Python (2.6.6)
I've googled around but can't seem to find the answer to this..can someone point me in the right direction?
Thanks,
Darcy