$ pip install browsermob-proxy
将二进制文件从https://bmp.lightbody.net下载到/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
以下内容: 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*
答案 0 :(得分:0)
尝试将实际目录添加到PATH
echo 'export PATH=$PATH:/Users/ishandutta2007/Downloads/browsermob-proxy-2.1.4/bin' >> ~/.bashrc
这样就不用在Server实例上手动指定路径arg
from browsermobproxy import Server
dict = {'port': 8090}
server = Server(options=dict)