3

I'm trying to install browsermob-proxy, but after installing it and trying to use I'm getting an error: "Browsermob-Proxy binary couldn't be found in path provided: path/to/browsermob-proxy"

I installed Browsermob-Proxy using pip:

pip install browsermob-proxy

And then used the code I found in the internet:

from browsermobproxy import Server
server = Server("/anaconda3/lib/python3.7/site-packages/browsermobproxy/")
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

server.stop()
driver.quit()

Executing this code, I'm getting and error "Browsermob-Proxy binary couldn't be found in path provided: /anaconda3/lib/python3.7/site-packages/browsermobproxy/".

Googled but didn't find a solution.

I checked answers to this question Getting error "Browsermob-Proxy binary couldn't be found in path provided: path/to/browsermob-proxy" after installation of Browsermob-Proxy, but the code provided there results in the same error.

Can someone help me please?

Thank you

  • 5
    I found the solution. Just doing pip install browsermob-proxy, won't work. You need to go to https://bmp.lightbody.net, download the zip, unzip and then when calling Server() in your python script, identify path to the executable from the zip you just created. It is located in "bin" folder and is called browsermob-proxy. – Tony Simonovsky May 04 '19 at 21:43

0 Answers0