使用Python爬虫爬取数据时,需要用到selenium,在服务器上运行时,需要如下配置:
一、centos系统
1、安装谷歌浏览器
yum install https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm -y
注:最近使用上面的命令在另外一台机器上安装的时候,报依赖包错误:
Error: Package: google-chrome-stable-126.0.6478.126-1.x86_64 (/google-chrome-stable_current_x86_64)
Requires: libc.so.6(GLIBC_2.25)(64bit)
可以看到最新版的是126版本的,然后尝试更新libc依赖,仍为解决,那就干脆使用上次的118版本,使用如下命令安装:
yum install https://dl.google.com/linux/chrome/rpm/stable/x86_64/google-chrome-stable-118.0.5993.117-1.x86_64.rpm -y
或者也可以结合