1

I used to log the performance stats of my web scraper with:

d = DesiredCapabilities.CHROME.copy()
# logs
d['goog:loggingPref'] = {'performance':'ALL'}

But after the latest updates I can't seem to make it work.

logs = driver.get_log('performance')

Now I get the following error:

InvalidArgumentException: Message: invalid argument: log type 'performance' not found (Session info: chrome=114.0.5735.198)

Did anything change in some recent updates about the way I need to initialize the performance logging in DesiredCapabilities?

viktor
  • 185
  • 12

1 Answers1

1

DesiredCapabilities which was earlier deprecated, is now removed in Selenium v4.10.


Solution

You have to use an instance of ChromeOptions as follows:

from selenium.webdriver.chrome.options import Options

options = Options()
options.set_capability('goog:loggingPrefs', {'performance': 'ALL'})
driver = Chrome(options=options)
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352