在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. br 词根 分支 broad bread branch brother broom 看到abroad后查到的

    br-分支 cl-集合 pater-父亲 br/other 兄弟-br/oom笤帚-br/eed繁殖-br/ood一窝-br/eak打破-br/anch分枝 cl/ash碰撞-class/ify分类- ...

  2. k8s架构解析

    Kubernetes(K8s)是一个开源的容器编排平台,用于自动化部署.扩展和管理容器化应用程序.Kubernetes由多个组件组成,每个组件都扮演着不同的角色.以下是Kubernetes中一些主要组 ...

  3. 逆向通达信Level-2 续七 (调试内置WebView)

    通过窗口找WebView,打开DevTool调试 在WebView hack入控制台.那个,我已经打开了DevTool,算了. 通过pad面板找WebView. 逆向通达信Level-2 续十一 (无 ...

  4. Handler源码解析

    Handler源码解析 一.基本原理回顾 在android开发中,经常会在子线程中进行一些操作,当操作完毕后会通过handler发送一些数据给主线程,通知主线程做相应的操作. 探索其背后的原理:子线程 ...

  5. 性能优化:编译器优化选项 -O2/-O3 究竟有多强大?

    之前的"性能优化的一般策略及方法"一文中介绍了多种性能优化的方法.根据以往的项目经验,开启编译器优化选项可能是立竿见影.成本最低.效果最好的方式了. 这么说可能还不够直观,举个真实 ...

  6. 记录--你不知道的Js高级方法

    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 前言 在Js中有一些比较冷门但是非常好用的方法,我在这里称之为高级方法,这些方法没有被广泛使用或多或少是因为存在一些兼容性的问题,不是所有 ...

  7. Python 如何发送带Excel附件的邮件

    import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart f ...

  8. c# webBrowser中操作网页元素全攻略

    1.获取非input控件的值: webBrowser1.Document.All["控件ID"].InnerText; 或webBrowser1.Document.GetEleme ...

  9. 关于FTP文件传输协议说明,带你了解更详情的文件传输协议

    Internet和其他网络上的人与设备之间的通信使用协议进行.您可以说协议定义了对话规则:谁必须在何时发送哪些信息?如果数据没有到达接收者,会发生什么?您如何保护转帐免受错误和犯规?每当我们使用Int ...

  10. Python字典遍历

    1 def dict_test(): 2 #初始化字典 3 dict= {"a1":"1","a2":"2"," ...