How to use browsermob with python-selenium?

前端 未结 4 525
旧巷少年郎
旧巷少年郎 2020-12-09 11:42

I want to use browsermob to monitor the network connections when doing a GUI test with selenium. I have found some information and documentation here and here and here, but

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-09 12:14

    This problem is related to the fact, that installation of browsermob-proxy is not just doing:

    pip install browsermob-proxy
    

    After you executed the code above, you need to go to https://bmp.lightbody.net, download the zip, unzip it 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.

    In my case it was:

    server = Server("/anaconda3/lib/python3.7/site-packages/browsermobproxy/browsermob-proxy-2.1.4/bin/browsermob-proxy")
    

提交回复
热议问题