gpt4 book ai didi

python - Selenium-rc:如何在 python 中使用 CaptureNetworkTraffic

转载 作者:太空狗 更新时间:2023-10-29 21:04:17 25 4
gpt4 key购买 nike

我在 java 中找到了许多关于 selenium 的教程,其中您首先使用 s.start("captureNetworkTraffic=True") 启动 selenium,但在 python 中 start() 不接受任何参数。

你如何传递这个论点?或者你不需要在 python 中使用它?

最佳答案

我更改了 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)

你做的:

sel = selenium.selenium('localhost', 4444, '*firefox', 'http://www.google.com')
sel.start(True)
sel.open('')
print sel.captureNetworkTraffic('json')

它就像一个魅力

关于python - Selenium-rc:如何在 python 中使用 CaptureNetworkTraffic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3712278/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com