from selenium import webdriver

def test1():
url='http://www.baidu.com'
driver=webdriver.Chrome("/usr/local/bin/chromedriver")
driver.get(url) if __name__ == '__main__':
test1()

  1.下载Chrome对应版本的数据驱动

  访问https://npm.taobao.org/mirrors/chromedriver/ 链接 找到你的chrome对应的版本,下载

mac下载完成后在当前下载路径可直接解压缩。 找到电脑搜索按钮。找到/usr/local/bin/目录 拷贝。认证。进行运行项目即可启动 浏览器

如还报路径错误

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

通用-打开。来自身份不明的开发者 点击 仍要打开 在启动项目即可解决路径问题

总结:

此错误就是找不到数据驱动

也就是路径问题,路径正确即可

另:

在加载数据驱动时 这个

Chrome开头一定要大些。不然无法调用驱动
webdriver.Chrome

错误提示:

driver=webdriver.chrome("/usr/local/bin/chromedriver")
TypeError: 'module' object is not callable

mac-webui-selenium下的webdriver selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH的更多相关文章

  1. 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 下载后拷贝到 ...

  2. selenium使用遇到的问题(selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH.)

    1.安装pip3 install selenium 2.使用browser=webdriver.Chrome()时报错 :selenium.common.exceptions.WebDriverExc ...

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

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

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

    解决办法: 把chromedriver exe文件放到python scripts目录下

  5. 解决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://version/. 2.到https://sites.google.com/a/chromium.org/chromedriver/downloa ...

  6. python 安装selenium首次运行错误selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    问题原因: 没有安装相关的支撑driver https://npm.taobao.org/mirrors/chromedriver/ 下载对应的driver 放置到python路径下

  7. windows下使用selenium报错selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH

    问题 :执行程序代码报错: WebDriverException:Message:'geckodriver'executable needs to be in Path 或者 selenium.com ...

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

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

  9. selenium使用报错“selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.”

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

随机推荐

  1. rabbit_消费者

    import pika import json import time import os import ast import uuid import time import json import ...

  2. Step By Step(Lua模块与包)

    Step By Step(Lua模块与包) 从Lua 5.1开始,我们可以使用require和module函数来获取和创建Lua中的模块.从使用者的角度来看,一个模块就是一个程序库,可以通过requi ...

  3. Jmeter- 笔记6 - 负载测试

    普通场景介绍 1.线程数:并发用户数 2.Ramp-Up时间:启动时间(线程数的准备时间),在这个时间点结束时,所有用户都已运行起来 3.循环次数:每个线程数都要运行的次数.永远 和 调度器一起使用, ...

  4. Python+Selenium学习笔记9 - 警告框处理

    如下图所示,这种窗口是不能通过前端工具对其进行定位的,这里可以通过switch_to_alert()方法去接受这个弹窗 1 # coding = utf-8 2 3 from selenium imp ...

  5. anaconda同时集成Python2 和 Python3

    参考帖子,亲测有效: 利用anaconda同时使用python2和python3的方法 注意:最后一步是再对应的python环境中输入:conda install anaconda

  6. 手把手教你实现三种绑定方式(call、apply、bind)

    关于绑定首先要说下this的指向问题. 我们都知道: 函数调用时this指向window 对象调用函数时this指向对象本身 看下面得例子: // 1 function test(){ const n ...

  7. 使用OneFlow搭建神经网络

    使用OneFlow搭建神经网络 在 识别 MNIST 手写体数字 的例子中,通过 flow.layers 和 flow.nn 中提供的接口搭建了一个简单的 LeNet 网络.下面,将通过LeNet来介 ...

  8. MindSpore张量mindspore::tensor

    MindSpore张量mindspore::tensor MSTensor #include <ms_tensor.h> MSTensor定义了MindSpore Lite中的张量. 构造 ...

  9. 全卷积网络Fully Convolutional Networks (FCN)实战

    全卷积网络Fully Convolutional Networks (FCN)实战 使用图像中的每个像素进行类别预测的语义分割.全卷积网络(FCN)使用卷积神经网络将图像像素转换为像素类别.与之前介绍 ...

  10. Spring Cloud系列(五):服务网关Zuul

    在前面的篇章都是一个服务消费者去调用一个服务提供者,但事实上我们的系统基本不会那么简单,如果真的是那么简单的业务架构我们也没必要用Spring Cloud,直接部署一个Spring Boot应用就够了 ...