在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. whale - awesome 关联单词

    whale - awesome 关联单词 whale 对应 awesome 里面的 awe 两个含义应该是一样的. whale wa哇-惊叹词-大型海洋生物-鲸鱼 来自古英语hwael,大型海洋生物, ...

  2. 常用Linux系统性能分析命令

    Linux系统提供了许多命令来分析系统性能.以下是一些常用的Linux系统性能分析命令: top:实时监视系统的运行状态和进程信息,包括CPU使用率.内存使用情况.进程状态等. 实例:直接在终端中输入 ...

  3. pcm5102芯片解析之基本概念

    一 前记 1 在音频领域深耕,那就要不断的前行.最近有几个项目需要用到pcm5102这颗料,藉此机会,针对这个料进行深入的研究一下.做一一些简要的分析. 二 概念 音频芯片的指标,其实,很多年都没啥变 ...

  4. Git | Git Server 搭建,在自己的服务器上进行 git server 搭建

    系列文章目录 目录 系列文章目录 前言 操作 1. 创建 git 用户 2. 创建 .ssh 目录 3. 自定义仓库的根目录 4. 在服务器上创建个裸仓库 5. 手动配置一个公钥 6. 在本地测试一下 ...

  5. day03-1-查看账单&结账功能

    满汉楼03 4.功能实现05 4.8查看账单功能 按照之间搭建起来的框架,在BillService编写方法 4.8.1代码实现 1.修改Bill类 重写Bill类中的toString方法 @Overr ...

  6. linux下几种快速清空文件内容的方法

    [root@iamzken ~] : > filename [root@iamzken ~] > filename [root@iamzken ~] echo "" & ...

  7. 04_QT_Windows开发环境搭建

    FFmpeg 为什么选择FFmpeg? 每个主流平台基本都有自己的音视频开发库(API),用以处理音视频数据,比如: iOS:AVFoundation.AudioUnit等 Android:Media ...

  8. 使用zxing来生成二维码

    使用zxing来生成二维码 二维码已经成为了现代生活中不可或缺的一部分,无论是商业还是个人使用,二维码都有着广泛的应用.而在二维码的生成过程中,zxing是一款非常优秀的开源库,它提供了一系列的API ...

  9. .Net依赖注入神器Scrutor(下)

    前言 上一篇文章我们讲到了Scrutor第一个核心功能Scanning,本文讲解的是Scrutor第二个核心的功能Decoration 装饰器模式在依赖注入中的使用. 装饰器模式允许您向现有服务类中添 ...

  10. 风场可视化学习笔记:openlayers

    最近在弄地图控件方面的东西,这里分享一个我找到的一个添加风场的教程和demo,需要对大家有所帮助(以下为转载内容)载于https://blog.csdn.net/u010065726/article/ ...