zoukankan      html  css  js  c++  java
  • 解决:WebDriverException: 'chromedriver' executable needs to be in PATH

    tags: 错误故障, WebDriver, Selenium, Python

    在 Python 下引用 Selenium 包开发时,刚开始测试 WebDriver 的功能直接就甩出了一个错误消息然后就中断了,错误消息:WebDriverException: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

    搜索并尝试一番后,顺利解决。方法如下:

    1. 安装 selenium 的 python 包之后,还要安装浏览器 driver
      我用的是 Chrome,以此为例:
      a. 下载 ChromeDriver。其它浏览器参见官网说明
      b. 复制 chromedrive 文件到 Google Chrome 程序目录下。各操作系统里的位置路径可以参考官方Wiki
    2. Python 代码里创建 webdriver 对象时传递 chromedrive 路径
    chromedriver = "/Applications/Google Chrome.app/Contents/MacOS/chromedriver"
    browser = webdriver.Chrome(chromedriver)```
    
    ---
    
    相关:[Python + Selenium 开发的准备工作](http://www.cnblogs.com/buchiany/p/6399688.html)
    
    
    _[正文结束]_
    
    
    _[更新记录]_
    2016-12-16, 初建笔记
  • 相关阅读:
    倒计时2(小于0时的格式)
    日期 Date()
    倒计时5(超过时间为0:0:0)
    倒计时4
    倒计时3
    Lucene_solr
    Solr与tomcat搭建(搭建好)
    SSM(Spring-SpringMvc-Mybatis)练习
    SpringMvc
    Mybatis(使用)与Spring整合
  • 原文地址:https://www.cnblogs.com/buchiany/p/6379305.html
Copyright © 2011-2022 走看看