有些团体知道如何在Selenium WebDriver中拦截/获取请求网址(XHR)和响应?有可能吗?
答案 0 :(得分:1)
它不受webdriver直接支持,但您可以通过代理重定向来捕获所有流量。在java ..
Proxy proxy = new Proxy();
// This should be the address of proxy.
proxy.setHttpProxy("localhost:8080");
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(CapabilityType.PROXY, proxy);
WebDriver driver = new FirefoxDriver(capabilities);