linux下启动selenium-爬虫并安装谷歌浏览器和驱动

一.升级yum

[root@selenium ~]# yum update -y
[root@selenium ~]# yum -y groupinstall "Development tools"
[root@selenium ~]# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel psmisc libffi-devel

 

二.配置谷歌浏览器安装

第一步

[root@selenium ~]# vim /etc/yum.repos.d/google-chrome.repo

 

第二步

#按i进入编辑模式粘贴内容
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
#:wq保存退出

第三步

[root@selenium ~]# yum -y install google-chrome-beta.x86_64 --nogpgcheck
#你也可以查看你的版本yum list | grep chrome
#安装是否成功查询
[root@selenium ~]# google-chrome --version

三.安装驱动

驱动去官网下载:https://sites.google.com/a/chromium.org/chromedriver/downloads
上传至于/usr/local/bin/文件目录
给与权限即可

[root@selenium ~]#  chmod 777 /usr/local/bin/chromedriver

四.卸载驱动(需要卸载可操作此步骤)

# yum remove google-chrome

删除旧驱动包文件

[root@selenium ~]# cd /usr/local/bin/
[root@selenium bin]# ls
chromedriver
[root@selenium bin]# rm -rf chromedriver

上传新的驱动

[root@selenium bin]# rz chromedriver
chromedriver

安装新的浏览器

[root@selenium bin]# yum -y install google-chrome-beta.x86_64 --nogpgcheck

 

给与权

[root@selenium bin]# chmod 777 /usr/local/bin/chromedriver

 


从新安装驱动完成
posted @   阿布_alone  阅读(367)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 25岁的心里话
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列01:轻松3步本地部署deepseek,普通电脑可用
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
历史上的今天:
2018-11-27 day29 进程
TOP
点击右上角即可分享
微信分享提示