老早就遇到这个Message: invalid argument: log type 'performance' not found问题,
网上能搜索到的全都是下面这种方法:
selenium回退旧版本并加入下面这句话
chrome_options.add_experimental_option('w3c', False)
然而新版selenium加入w3c这句代码一样会报错,必须回退版本才能用。
我想用新版的selenium怎么这么难,最后经过大量搜索终于发现原因:
caps['loggingPrefs'] = {'performance': 'ALL'}
改为
caps["goog:loggingPrefs"] = {"performance": "ALL"}
即可解决这个报错,就是新版selenium改名了,网上太难找了。