首页 技术 正文
技术 2022年11月21日
0 收藏 788 点赞 4,638 浏览 1483 个字

对于谷歌Chrome32位版本,使用如下链接:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb

对于64位版本可以使用如下链接下载:

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb

下载完后,运行如下命令安装。

sudo dpkg -i google-chrome*;

sudo apt-get -f install

可能出现的问题:

一:启动Chrome浏览器

  1. # google-chrome

这时会报错:

[31560:31560:0207/085601.085852:ERROR:zygote_host_impl_linux.cc(90)] Running as root without –no-sandbox is not supported. See https://crbug.com/638180.

解决方法:

  1. # google-chrome –no-sandbox

仍会报错:

root@node00:~# [0207/085735.495265:ERROR:nacl_helper_linux.cc(310)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

解决方法:

    

  1. # whereis google-chrome
  2. google-chrome: /usr/bin/google-chrome /usr/share/man/man1/google-chrome.1.gz
  3. # vim /usr/bin/google-chrome

将 exec -a “$0” “$HERE/chrome” “$@”  改为

exec -a “$0” “$HERE/chrome” “$@” –user-data-dir –no-sandbox

以后只要 google-chrome 就可以打开Chrome了

如果不行:可能就是缺少chromeDriver了

  

错误:

selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally (Driver info: chromedriver=2.34.522913 (36222509aa6e819815938cbf2709b4849735537c),platform=Linux 4.10.0-42-generic x86_64)

解决办法:

Start the Display before start the Chrome.

先执行一下两句安装命令(以ubuntu为例):

  1. pip install pyvirtualdisplay
  2. sudo apt-get install xvfb

然后添加如下代码:

  1. from pyvirtualdisplay import Display
  2. display = Display(visible=0, size=(800, 800))
  3. display.start()
  4. driver = webdriver.Chrome()

驱动映射表:

https://blog.csdn.net/zhanghua_ting/article/details/79498152

安装selenium

pip3 install selenium

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,910
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,435
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,250
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,061
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,693
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,731