I'm trying to get INFO level browser console log events from Edge using Python/Selenium on PyCharm but current configuration only returns WARNING level logs from browser. I'm using msedge.selenium_tools library intentionally because webdriver library on Edge seems to be deprecated.
import time
from msedge.selenium_tools import EdgeOptions
from msedge.selenium_tools import Edge
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
capabilities = DesiredCapabilities.EDGE
capabilities['loggingPrefs'] = {'browser': 'ALL'}
capabilities['acceptInsecureCerts'] = bool(True)
edge_options = EdgeOptions()
edge_options.binary_location = r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"
edge_options.use_chromium = True
driver = Edge(options=edge_options, desired_capabilities=capabilities, executable_path=r"C:\\Users\\myuser\\Documents\\edgedriver_win64\\msedgedriver.exe")
...
Output:
[{'level': 'WARNING', 'message': 'Message I'm getting'}]