I'm currently using selenium to get console logs from a chrome browser. My setup code is this and it works well for getting console logs
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# enable browser logging
d = DesiredCapabilities.CHROME
d['goog:loggingPrefs'] = { 'browser':'ALL' }
driver = webdriver.Chrome(desired_capabilities=d)
# load the desired webpage
driver.get(http://192.168.5.5)
# print messages
for entry in driver.get_log('browser'):
print(entry)
The problem is that entry is a dictionary that contains a string of Objects. I can not access what is inside this Object. In a real browser I can expand on these objects and see further information which is usually in the form of a dictionary. How do I get access to these console log object's in python like I would on a browser? It does not have to be through selenium if it is not possible in selenium.
Edit:
Example of the output from entry:
{'level': 'INFO', 'message': 'http://192.168.5.5/app.e52b3dcc.bundle.js 58:31633 "[END REQUEST]: Response:" Object Object', 'source': 'console-api', 'timestamp': 1663609942539}
Example of the object expanded in the browser (The copy and paste doesn't look as good here but you get the idea):
```END REQUEST]: Response:
Object
data1
:
"SOMEPIECEOFDATA"
response
:
{moreData: {…}, status: 1, type: 'response'}
[[Prototype]]
:
Object