2024-10-01 11:32:35 发布
网友
我在java中找到了许多关于selenium的教程,其中首先使用s.start("captureNetworkTraffic=True")启动selenium,但是在python中start()不接受任何参数。在
s.start("captureNetworkTraffic=True")
start()
你如何通过这个论点?或者你不需要在python中使用它吗?在
以“代理注入模式”启动浏览器(注意*pifirefox而不是{})。然后可以调用captureNetworkTraffic方法。在
*pifirefox
captureNetworkTraffic
import selenium import time sel=selenium.selenium("localhost",4444,"*pifirefox","http://www.google.com/webhp") sel.start() time.sleep(1) print(sel.captureNetworkTraffic('json'))
我学会了*pifirefox“技巧”here。在
我在selenium.py中更改了start:
selenium.py
start
def start(self, captureNetworkTraffic=False): l = [self.browserStartCommand, self.browserURL, self.extensionJs] if captureNetworkTraffic: l.append("captureNetworkTraffic=true") result = self.get_string("getNewBrowserSession", l)
你所做的:
它就像一个符咒
以“代理注入模式”启动浏览器(注意})。然后可以调用
*pifirefox
而不是{captureNetworkTraffic
方法。在我学会了
*pifirefox
“技巧”here。在我在
selenium.py
中更改了start
:你所做的:
^{pr2}$它就像一个符咒
相关问题 更多 >
编程相关推荐