Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在BrowserMob Selenium和Python中运行多个服务器_Python_Selenium_Browsermob - Fatal编程技术网

如何在BrowserMob Selenium和Python中运行多个服务器

如何在BrowserMob Selenium和Python中运行多个服务器,python,selenium,browsermob,Python,Selenium,Browsermob,大家好,我想在pythonwant中运行多个browsermob服务器,以同时检测两个chrome浏览器的http,但稍后可以将其分离,但是当我将第二个服务器分配给第二个代理时,我得到错误“无法解码json对象” 我的代码如下 server1 = Server(path_browsermobproxy, options={'port':9090}) server1.start() proxy1 = server1.create_proxy() profile1 = webdriver.Fi

大家好,我想在pythonwant中运行多个browsermob服务器,以同时检测两个chrome浏览器的http,但稍后可以将其分离,但是当我将第二个服务器分配给第二个代理时,我得到错误“无法解码json对象”

我的代码如下

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())

下载最新版本

然后传递一个新的代理端口create_proxy{port:9911}


browsermobproxy将始终尝试使用端口8081,第二个实例将自动崩溃

create_proxy{port:9911}当我运行此命令时,它会给我参数错误?然后直接从git repo更新验证。pip版本很旧