I am trying to get the performance logs of Chromedriver to get access to all network data. The chromedriver is connecting to an Electron app. I tried all the solutions previously discussed here but none seem to work.
caps = DesiredCapabilities.CHROME
caps["goog:loggingPrefs"] = {'performance': 'ALL'}
service = Service(executable_path="./chromedriver.exe")
option=Options()
option.binary_location=path.abspath("./tsm-console-desktop.exe")
option.add_argument("remote-debugging-port=9515")
cdriver=webdriver.Chrome(service=service,options=option,desired_capabilities=caps)
I then run
# Electron app loads the set url automatically
cdriver.get_log('browser')
All the answers say to run cdriver.get_log('performance')
but Python complains it as invalid argument.
The output log does not have any method information , only console information
{'level': 'SEVERE', 'message': 'https://dev.local.elektaplatform.com/otel-agent/v1/traces - Failed to load resource: the server responded with a status of 404 ()', 'source': 'network', 'timestamp': 1659614239337}
Any ideas?
UPDATE:
Using the executable argument in the WebDriver constructor worked for me, instead of using Service
webdriver.Chrome(executable_path='./chromedriver.exe',options=option,desired_capabilities=caps)