selenium-chromedriver - Chromedriver 在 Centos 7 上没有响应

标签 selenium-chromedriver centos7 google-chrome-headless

嗨,在 headless centos 7 中,我正在尝试进行 headless selenium 测试。 为此,我安装了 google-chrome、chromedriver 和 selenium pip 包,但我没有成功,这就是我所做的。

谷歌浏览器版本:

yum list installed |grep google-chrome
google-chrome-stable.x86_64             83.0.4103.106-1                @google-chrome

我从这个 link 下载了 chrome 驱动程序版本 83.0.4103.39 , 解压并移动到 /usr/bin/local

-rwxr-xr-x   1 root root 10774816 May  5 23:53 chromedriver

并且该路径也在 env 中。

PATH=...:/usr/local/bin/chromedriver:/usr/local/bin/

当我在终端中输入 chromdriver 时,没有任何反应。它只是卡住。我在公司代理后面,所以我不能真正尝试更改防火墙等。我做错了什么?

最佳答案

不要将二进制可执行文件放在 $PATH 上,而只放在目录 /usr/local/bin 上。

您必须在编辑配置文件后获取配置文件:。 ~/.bashrc.

并且您可能必须将其配置为 headless 模式:

options = webdriver.ChromeOptions()
options.add_argument('window-size=1920x1080');
options.add_argument('--headless')
options.add_argument('--incognito');

同时检查那里是否存在可能的警报:sealert -a/var/log/audit/audit.log

关于selenium-chromedriver - Chromedriver 在 Centos 7 上没有响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62406570/

相关文章:

python 脚本无法调用 azure 上的 chrome 驱动程序

java - Selenium - chrome 驱动程序无法在后台启动(没有启动窗口)

python - Selenium 无法打开指定的 URL 并显示数据 :,

java - 使用 Chromedriver 在 Chrome 中无法使用热键(快捷方式)

laravel - 使用 Laravel/Dusk 在 headless chrome 中下载文件

centos - 如何在 CentOS 7 上安装 zookeeper 作为服务

python - 通过 Python 的 dbus 模块控制 CentOS 中的 firewalld?

linux - Startx 和 VNC 无法在 AWS Lightsail CentOS7 上运行

c# - 如何在 HeadlessChrome 中解决 "You are using an unsupported command-line flag: --ignore-certificate-errors, Stability and security will suffer"

ruby - 带有 Selenium 的 Chromedriver 远程调试端口