简体   繁体   中英

What should be the path of browsermob-proxy when installed as pypi package

$ pip install browsermob-proxy

Downloaded and extracted the binary from https://bmp.lightbody.net to /Users/ishandutta2007/Downloads/browsermob-proxy-2.1.4/

from browsermobproxy import Server
dict = {'port': 8090}
server = Server(options=dict)
server = Server(path="/Users/ishandutta2007/Downloads/browsermob-proxy-2.1.4/bin/browsermob-proxy", options=dict)

Browsermob-Proxy binary couldn't be found in path provided: browsermob-proxy

Following: https://github.com/AutomatedTester/browsermob-proxy-py

$ ls -l "/Users/ishandutta2007/Downloads/browsermob-proxy-2.1.4/bin"

total 16
-rwxr--r--@ 1 ishandutta2007  staff   781B Dec 26  2016 browsermob-proxy*
-rwxr--r--@ 1 ishandutta2007  staff   2.7K Dec 24  2016 browsermob-proxy.bat*
drwxrwxr-x@ 3 ishandutta2007  staff   102B Sep  5 01:07 conf/

$ ls -l "/Users/ishandutta2007/Downloads/browsermob-proxy-2.1.4/bin/browsermob-proxy"

-rwxr--r--@ 1 ishandutta2007  staff   781B Dec 26  2016 /Users/ishandutta2007/Downloads/browsermob-proxy-2.1.4/bin/browsermob-proxy*

Try to add the actual directory to the PATH

echo 'export PATH=$PATH:/Users/ishandutta2007/Downloads/browsermob-proxy-2.1.4/bin' >> ~/.bashrc

This way you don't have to specify the path arg on the Server instance manually

from browsermobproxy import Server
dict = {'port': 8090}
server = Server(options=dict)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM