How can I log all HTTP requests and responses of a page load over Webdriver with PhantomJS? I am using python and my super simple test script looks like this:
from selenium import webdriver
driver = webdriver.PhantomJS()
driver.get('http://www.golem.de')
I already found the capabilities in PhantomJS:
page.onResourceRequested = function (request) {
console.log('Request ' + JSON.stringify(request, undefined, 4));
};
But I don't know how to stick this together with Selenium Webdriver respectively Ghostdriver. How could I do this?