在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. printJS 打印 无头无尾 style 加 @page { margin: 0; } body { padding: 100px;}

    // 使用npm模块 print-js printJS({ printable: this.printData, type: 'json', documentTitle: ' ', propertie ...

  2. Educational Codeforces Round 141:B. Matrix of Differences

    一.来源:Problem - B - Codeforces 二.题面 三.思路 我们先从一维思考如何构造尽可能多的数值差.以n=2为例,此时有1,2,3,4数,其中构成差值为3的方案有一个1,4,构成 ...

  3. 百度api经历

    底部参考文档,欢迎点击:https://www.runoob.com/http/http-content-type.html 这两天遇到了点糟心事,因为小伙伴走了.然后事情起因是这样的,来了个任务封装 ...

  4. Tomcat异常之 Exception loading sessions from persistent storage解决方案

    启动项目时报以下异常 严重: Exception loading sessions from persistent storage java.io.EOFException 遇到上述异常,删除Tomc ...

  5. 3DCAT首届行业生态交流会|瑞云科技技术总监赵志杰:实时渲染助力元宇宙应用触手可及

    2021年12月17日下午,由深圳市瑞云科技有限公司主办,深圳市虚拟现实产业联合会协办的 云XR如何赋能元宇宙--3DCAT实时云渲染首届行业生态合作交流会 圆满落幕.此次活动围绕 "云XR ...

  6. 记录--居中为什么要使用 transform?

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 引言 居中是我们在前端布局中经常会遇到的问题,其中包括水平居中和垂直居中.居中的方法很多,比如说水平居中可以使用text-align: c ...

  7. 记录--JS 的垃圾回收机制

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 前言 垃圾回收(Garbage Collection)是一种内存管理机制,用于检测和清理不再被程序使用的内存,这些不再被使用的内存就被称为 ...

  8. 记录--你真的能区分JavaScript的各种导入导出方式吗?

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 前言 我们在无论是在查阅别人的代码,还是在实际项目开发的过程中,肯定都会使用导入导出的功能,有时候我们会搞混这几种方式到底有什么区别,今天 ...

  9. Oracle查询表空间信息

    记录一下 SELECT UPPER(F.TABLESPACE_NAME) "表空间名", D.TOT_GROOTTE_MB "表空间大小(M)", D.TOT_ ...

  10. 感悟:FPGA的串行及并行设计思路

    前言 FPGA设计过程中, 会遇到大量的串行转并行或者并行转串行的问题; 这些问题主要体现在FPGA对于速度和面积的均衡上; 一般而言, FPGA使用并行的设计可以提高处理的速度, 消耗更多的资源; ...