0

Hi I was trying to run browsermob-proxy on google colab but was constantly getting the error: Could not read Browsermob-Proxy json Another server running on this port?

Also I tried to find code on the internet on how to use browsermob-proxy on google colab, but didn't find it.

Can you provide a working code or link for the same.

1 Answers1

0

This is the code that works for me:

#!/usr/bin/python
# coding=utf-8
%cd path/browsermob-proxy-2.1.4/bin
!chmod -R 777 *
from browsermobproxy import Server
dict={'port':8090}
server = Server('./browsermob-proxy',options=dict)
server.start()
proxy = server.create_proxy()

you need to change the current working directory to the path/browsermob-proxy-2.1.4/bin folder, and then use !chmod -R 777 * to modify the file permissions. Point to the file without .bat

If the local port being used, There will appear Errno 8 error warning. You need to add a port options dict