如何 运行 BrowserMob Selenium 中的多个服务器和 Python
How to run Multiple Servers in BrowserMob Selenium and Python
大家好,我想 运行 python 中的多个 browsermob 服务器(想同时检测两个 chrome 浏览器的 http,但稍后可以将其分开),但是,当我将第二个服务器分配给第二个代理时,出现错误 'No json object could be decoded'
我的代码如下
server1 = Server(path_browsermobproxy, options={'port':9090})
server1.start()
proxy1 = server1.create_proxy()
profile1 = webdriver.FirefoxProfile()
profile1.set_proxy(proxy1.selenium_proxy())
server2 = Server(path_browsermobproxy, options={'port':9091})
server2.start()
proxy2 = server2.create_proxy()
profile2 = webdriver.FirefoxProfile()
profile2.set_proxy(proxy2.selenium_proxy())
下载最新版本
https://github.com/automatedtester/browsermob-proxy-py
然后传递一个新的代理端口create_proxy({"port":9911})
browsermobproxy 将始终尝试使用端口 8081,第二个实例将无提示地崩溃
大家好,我想 运行 python 中的多个 browsermob 服务器(想同时检测两个 chrome 浏览器的 http,但稍后可以将其分开),但是,当我将第二个服务器分配给第二个代理时,出现错误 'No json object could be decoded'
我的代码如下
server1 = Server(path_browsermobproxy, options={'port':9090})
server1.start()
proxy1 = server1.create_proxy()
profile1 = webdriver.FirefoxProfile()
profile1.set_proxy(proxy1.selenium_proxy())
server2 = Server(path_browsermobproxy, options={'port':9091})
server2.start()
proxy2 = server2.create_proxy()
profile2 = webdriver.FirefoxProfile()
profile2.set_proxy(proxy2.selenium_proxy())
下载最新版本
https://github.com/automatedtester/browsermob-proxy-py
然后传递一个新的代理端口create_proxy({"port":9911})
browsermobproxy 将始终尝试使用端口 8081,第二个实例将无提示地崩溃