欢迎光临散文网 会员登陆 & 注册

centos 安装谷歌浏览器和selenium环境

2022-07-31 13:05 作者:限量版范儿  | 我要投稿

1,安装谷歌浏览器

vi /etc/yum.repos.d/google-chrome.repo

name=google-chrome baseurl=https://dl.google.com/linux/chrome/rpm/stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://dl.google.com/linux/linux_signing_key.pub

yum -y install google-chrome-stable --nogpgcheck

2,安装selenium

yum -y install epel-release

yum install python-pip -y

pip2.7 install  selenium

 

注意:

1,运行要用headless模式运行

chrome_options.add_argument('--headless')

2,root身份运行添加

chrome_options.add_argument('--no-sandbox')


原文链接:https://www.dianjilingqu.com/459472.html

centos 安装谷歌浏览器和selenium环境的评论 (共 条)

分享到微博请遵守国家法律