linux chromedriver报错 chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

场景在linux执行以下命令

chromedriver --version

报错信息

chromedriver: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

解决方案

apt-get install -y chromium
apt --fix-broken install -y

原因

由于 chromedriver 运行时依赖 glib 等多种系统库,逐个安装比较麻烦,因此我们直接安装 chromium,操作简单且更方便使用