Python使用selenium时,报错:
[7936:22948:0201/231814.412:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE is
代码之前都能正常运行,估计是和 Chromedriver 版本有关系,因为除了升级Chromedriver之外没有其他操作.
多次运行程序,发现上述错误不是经常出现,再次判断可能是网页加载不完全造成的。
所以出现错误不要紧张,多检查一下代码,和网页是否加载完全。
另附带网上的一些解释
错误信息:Passthrough is not supported, GL is swiftshader
解决方法:
错误信息Passthrough is not supported, GL is swiftshader
可能是在 Chromedriver 版本 89 之后显示的错误信息。
使用chromedriver时,一般都需要指定--headless
和--disable-gpu
参数,可以不显示浏览器的窗口,如果不使用这两个选项,则不会出现错误消息。
也可以使用--disable-software-rasterizer
参数,禁用 WebGL
,在不显示窗口的模式下,也不显示错误消息。
错误信息:Passthrough is not supported, GL is disabled)
解决方法:如上面方法不能解决,也可以尝试使用-enable-webgl --no-sandbox --disable-dev-shm-usage
参数来解决。