爬虫报错信息:Message: invalid argument: log type ‘performance‘ not found

爬虫报错信息:Message: invalid argument: log type ‘performance‘ not found,第1张

在使用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

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/570266.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-09
下一篇 2022-04-09

发表评论

登录后才能评论

评论列表(0条)

保存