python
2019-03-05

1、问题

做使用selenium控制chrome时,默认会开启gpu加速功能,但GPU加速可能导致在虚拟机Chrome的CPU占用率非常高。
那么如何关闭gpu加速功能呢?

2、办法

如下

chrome_opt = webdriver.ChromeOptions()
chrome_opt.add_argument('--disable-gpu')
文章链接:http://www.viper.im/archives/selenium-close-chrome-gpu.html
本文由viper.im 原创编译,转载请保留链接:selenium关闭chrome的gpu加速