在使用selenium访问网页时遇到问题,get_log('performance')失败,报错信息为:Message: invalid argument: log type 'performance' not found,
解决方法之一:
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
d = DesiredCapabilities.CHROME
d['loggingPrefs'] = { 'performance':'ALL' }
chrome_options = Options()
# 解决方法
chrome_options.add_experimental_option('w3c', False)
driver = webdriver.Chrome(desired_capabilities=d, options=chrome_options)
原链接为:python - Selenium Chrome can't see browser logs InvalidArgumentException - Stack Overflowhttps://stackoverflow.com/questions/56507652/selenium-chrome-cant-see-browser-logs-invalidargumentexception/56518199#56518199
|