在使用 Selenium 进行数据处理的过程中,发现了一些问题:

selenium.common.exceptions.WebDriverException: Message: chrome not reachable

WebDriverException: Message: unknown error: DevToolsActivePort file doesn't exist

首先确认我们的 ChromeDriver 和已经安装的 Chromium 的版本匹配没有问题

chromium-browser --version
Chromium 90.0.4430.212 Fedora Project
../../driver/chromedriver --version
ChromeDriver 89.0.4389.23 (61b08ee2c50024bab004e48d2b1b083cdbdac579-refs/branch-heads/4389@{#294})

但是,之后发现问题依然存在。

经历了大量的调查,应该是上次使用 webdriver 的时候,没有关闭浏览器,所以

[root@iz8vb7tuq6sw9mx44vk7p6z ~]# ps aux | grep Chrome
root     18561  0.0  0.0 112812   976 pts/5    R+   08:26   0:00 grep --color=auto Chrome
scrapy   19401  0.0  1.7 34313044 17356 pts/2  Sl   Nov02   0:12 /usr/bin/chromium-browser --enable-plugins --enable-extensions --enable-user-scripts --enable-printing --enable-gpu-rasterization --enable-sync --auto-ssl-client-auth --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --headless --log-level=0 --no-first-run --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.bV7kKM data:,
scrapy   19671  0.0  1.3 34300716 13676 pts/2  Sl   Nov02   0:11 /usr/bin/chromium-browser --enable-plugins --enable-extensions --enable-user-scripts --enable-printing --enable-gpu-rasterization --enable-sync --auto-ssl-client-auth --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --headless --log-level=0 --no-first-run --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.nm1tQ1 data:,
scrapy   31991  0.0  1.3 34300716 13328 pts/2  Sl   Nov02   0:10 /usr/bin/chromium-browser --enable-plugins --enable-extensions --enable-user-scripts --enable-printing --enable-gpu-rasterization --enable-sync --auto-ssl-client-auth --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-blink-features=ShadowDOMV0 --enable-logging --headless --log-level=0 --no-first-run --no-sandbox --no-service-autorun --password-store=basic --remote-debugging-port=0 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp/.com.google.Chrome.E71n9Z data:,

这里发现我们有3个 chromium 浏览器在运行,所以我们找到他们的 PID 并将他们一一关闭。

kill -9 PID

重新打开代码,就没有问题了

Centos 在 Selenium 使用中的异常:chrome not reachable相关推荐

  1. Selenium IDE录制脚本——Chrome浏览器使用介绍

    引言 前面已经讲过selenium的家族成员,其中一个成员就是这篇文章要讲的--selenium IDE. Selenium IDE介绍 selenium IDE结合浏览器提供脚本的录制,回放以及编辑 ...

  2. [解决问题]selenium.remote.UnreachableBrowserException 异常分析并解决问题

    [解决问题]selenium.remote.UnreachableBrowserException 异常分析并解决问题 参考文章: (1)[解决问题]selenium.remote.Unreachab ...

  3. centos cron 自动执行脚本异常 命令不生效的解决办法

    centos cron 自动执行脚本异常 命令不生效的解决办法 参考文章: (1)centos cron 自动执行脚本异常 命令不生效的解决办法 (2)https://www.cnblogs.com/ ...

  4. Selenium 远程调用 Google Chrome 谷歌浏览器

    Selenium 远程调用 Google Chrome 谷歌浏览器 一. 前沿 每次重新运行Selenium都直接弹出来,运行的次数多了菜单栏一堆谷歌浏览器 ,远程就可以解决重复弹出框的问题,还可以解 ...

  5. Python selenium使用中遇到的问题总结

    Python selenium使用中遇到的问题总结 1.现在selenium3.4的版本已经不支持PhantomsJS了,想要继续使用PhantomsJS的话,可以把selenium的版本改成2.48 ...

  6. Python+Selenium:初步使用Chrome谷歌浏览器

    ·············环境结合··············· 我的环境:window10 64位 Python 3.7 32-bit selenium 3.141.0 Google Chrome ...

  7. Selenium WebDriver ie,chrome 驱动

    在驱动ie,chrome 的时候需要下载驱动 从网上下载IEDriverServer,Chromedriver 然后需要配置下就可以驱动ie,chrome 浏览器了 selenium 驱动ie 和 c ...

  8. chrome 控制台信息获取 python_【python+selenium自动化】设置Chrome启动参数

    起因:直接用selenium的webdriver启动chrome,会弹出"Chrome正在受到自动软件的控制",并且窗口较小,是因为chrome没有加载任何配置 解决:点进sele ...

  9. 解决Chromedriver报错Original error: chrome not reachable

    切换webview时,提示:Original error: chrome not reachable. 报以上错误,主要是由于缺少chromeOptions的配置,加上下面这段(三种方式选需要的即可) ...

最新文章

  1. day3-函数参数及调用
  2. 每日一皮:项目开发停在了最后10%的效果...
  3. Tensorboard安装和访问(pytorch+MobaXterm)
  4. mysql制作html静态网页6_将数据库中的所有内容生成html静态页面的代码
  5. 成功解决ValueError: Parameter values for parameter (max_depth) need to be a sequence.
  6. 项目质量管理:质量与质量管理概念
  7. 启动MySQL报错:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost‘ (10061)
  8. jeecg社区第11期导师架构学习班开始报名了
  9. Win11这个界面你肯定没见过
  10. 前嗅ForeSpider教程:采集图片/视频/资源文件
  11. videojs如何获取请求消息_WEB之基于HTTP协议的几种实时数据获取技术
  12. 计算机网络防护,计算机网络防护方法与流程
  13. 计算机密码突然不正确,win10开机密码明明正确,win10密码突然不对了
  14. c语言 最大子段和,最大子段和 C语言源码
  15. Windows蓝屏代码集合
  16. NC系统销售业务说明
  17. Android11/Android Q分屏功能实现
  18. 修改MAC密码 Navicat每次打开都要输入密码
  19. 基于Dav快速搭建React开发框架
  20. 海王算法(看完不会变成海王)

热门文章

  1. JeecgBoot 2.4.2 积木报表版本发布,基于SpringBoot的低代码平台
  2. photoshop多选文字_60多个Photoshop文字效果教程
  3. TCP/IP协议栈 路由器 交换机
  4. C/C++ 光标:键盘上下键实现菜单移动
  5. 苹果手机怎么备份所有数据_数据蛙:微信怎么备份手机通讯录,随时备份和恢复手机联系人!...
  6. Windows下HdWiki安装步骤
  7. 叶蔬菜种子行业调研报告 - 市场现状分析与发展前景预测
  8. 子库存-OU-库存组织-关系
  9. 8T磁盘阵列文件存储服务器 威联通,NAS私有云老司机折腾体验记 篇八:QNAP 威联通TR-004磁盘阵列外接盒使用教程...
  10. 秒杀系统流量削峰这事应该怎么做?为什么要削峰呢?