在PyCharm中写好下列程序:

一运行遇到下列报错:

selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
于是在网上搜索了一下最终解决了我的问题,在这里记录一下:

1.先在Chrome地址栏中输入:chrome://version/    查看浏览器的版本

2.进入网站:http://chromedriver.storage.googleapis.com/index.html  下载与自己浏览器相适配的driver

3.将下载好的压缩包解压后,将chromedriver.exe放在所写程序的目录中。

另:在网上还看到一种方法,但是对于我来说没有用(我也不清楚为啥没用),还是记录一下

将chromedriver.exe放在安装的selenium库下

4.运行所写程序,就没有出错啦!

Python爬取网页遇到:selenium.common.exceptions.WebDriverException解决方法的更多相关文章

  1. python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...

  2. python爬取网页的通用代码框架

    python爬取网页的通用代码框架: def getHTMLText(url):#参数code缺省值为‘utf-8’(编码方式) try: r=requests.get(url,timeout=30) ...

  3. Python爬取网页信息

    Python爬取网页信息的步骤 以爬取英文名字网站(https://nameberry.com/)中每个名字的评论内容,包括英文名,用户名,评论的时间和评论的内容为例. 1.确认网址 在浏览器中输入初 ...

  4. 如何使用python爬取网页动态数据

    我们在使用python爬取网页数据的时候,会遇到页面的数据是通过js脚本动态加载的情况,这时候我们就得模拟接口请求信息,根据接口返回结果来获取我们想要的数据. 以某电影网站为例:我们要获取到电影名称以 ...

  5. 运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created

    运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created 原因: ...

  6. 【Python + Selenium】初次用IE浏览器之报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.

    初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launchi ...

  7. python无法启动火狐浏览器且报错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”

    安装了python2,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...

  8. 解决selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in P

    转载 解决selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be i ...

  9. centos7 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    1.查看安装的chrome浏览器版本 2.查看版本对应的驱动 https://sites.google.com/a/chromium.org/chromedriver/downloads 下载后拷贝到 ...

  10. selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 错误处理方法

    首次使用selenium webdriver,webdriver.Firefox() 报错selenium.common.exceptions.WebDriverException: Message: ...

随机推荐

  1. 完美解决浏览器输入http被自动跳转至https问题

    查阅相关资料,发现这是浏览器的HSTS(HTTP Strict Transport Security)功能引起的.在安装配置SSL证书时,可以使用一种能使数据传输更加安全的Web安全协议,即在服务器端 ...

  2. AWS API Gateway IP WhileList

    首先创建个API,然后进入API配置,点击左边的资源配置,加入以下配置: { "Version": "2012-10-17", "Statement& ...

  3. 使用正则表达式提取background:url()中的内容

    开发中经常碰见元素使用background或者background-imgae等样式表提供的属性来展示图片而不是img使用标签,在修改的时候就会发现弊端在需要动态修改图片的时候没有img.src那样顺 ...

  4. yum总纲

    yum总纲 yum源搭建 首先本文档讲解两种搭建方式,第一有网络环境和第二种无网络环境. 第一种:有网络环境 首先 进入系统执行:以下命令,获取网络源 wget -O /etc/yum.repos.d ...

  5. npm ERR! code ENOENT npm ERR! syscall open npm ERR! path C:\Users\shuzi\Desktop\保密文件项目\test-ui/package.json npm ERR! errno -4058

    打开一个新的项目,因为当前项目文件夹下没有npm,"dev": "npm run start:dev",所以所以没有展示对应的运行图,如下图: 打开一个新的前端 ...

  6. 记录--前端实现文件预览(pdf、excel、word、图片)

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 前端实现文件预览功能 需求:实现一个在线预览pdf.excel.word.图片等文件的功能. 介绍:支持pdf.xlsx.docx.jpg ...

  7. 【VMware ESXi】HP Z4G4 Workstation安装ESXi停留在Shutting down firmware services...的解决办法。

    家里有台HP Z4G4 Workstation工作站,底层安装运行了VMware的ESXi Hypervisor,作为Homelab的All in one环境. 之前安装ESXi 8的时候有个问题,在 ...

  8. Kingbase ES 自定义聚合函数浅析

    文章概要: 基于前面的博文<Kingbase ES 自定义聚合函数和一次改写案例>这篇文章,我们只考虑了自定义聚合函数非并行的情况, 因此,本篇文章将着重解析一下使用PLPGSQL编写并行 ...

  9. KingbaseES V8R6 运维案例 --flashback drop table

    一.KingbaseES V8R6 flashback drop table介绍 使用FLASHBACK删除和恢复表 删除表时,数据库不会立即删除与该表关联的空间.数据库重命名表,并将其和任何关联的对 ...

  10. KingbaseES 统计信息收集器没有响应问题分析

    统计信息收集器没有响应/Stats collector is not responding 问题现象: kingbase数据库日志提示:统计信息收集器没有响应/Stats collector is n ...