V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Abblee
V2EX  ›  Python

求助,各位大佬在搭建自动化测试环境 selenium 环境的时候一直检测不到 Firefox 的驱动,试过了网上的办法还是不行

  •  
  •   Abblee · 2018-05-30 14:15:55 +08:00 · 2012 次点击
    这是一个创建于 2129 天前的主题,其中的信息可能已经有所发展或是发生改变。

    一直出现“ AttributeError: module 'selenium.webdriver' has no attribute 'Firefox'”提示,试过很多方法都不行! TIM 截图 20180530061455.png

    8 条回复    2018-06-03 18:52:57 +08:00
    wudixiaomianyang
        1
    wudixiaomianyang  
       2018-05-30 14:55:10 +08:00
    java 里要指定 webdriver 的 url,System.setProperty("webdriver.chrome.driver", WEBDRIVER_URL); python 可以指定吗?
    Abblee
        2
    Abblee  
    OP
       2018-05-30 15:00:34 +08:00
    @wudixiaomianyang python 好像没有提到要制定 url
    zer
        3
    zer  
       2018-05-30 15:11:32 +08:00
    可以直接指定,webdriver.Firefox('URL')就行
    Abblee
        4
    Abblee  
    OP
       2018-05-30 15:22:48 +08:00
    @zer 试过了,指定 URL 还是不行
    goofool
        5
    goofool  
       2018-05-30 15:49:58 +08:00
    还有一个 selenium.py 文件?
    Sylv
        6
    Sylv  
       2018-05-30 16:00:07 +08:00 via iPhone
    报错应该说的是 selenium 库的问题,和驱动没关系,试着重装一下 selenium 库,或者像楼上说的项目目录里是不是还有个 selenium 同名文件?
    Mavious
        7
    Mavious  
       2018-06-03 14:29:16 +08:00
    selenium 坑真™巨多,我刚刚从 log 文件无权写入的巨坑里爬出来……然后一脚跌入被 selenium 打开的 ffox 不携带原浏览器的 cookies 的坑里,挂 profiles 都没用。

    LZ 确认下 geckodriver 支持的 ffox 版本号有没有对应,再看看 selenium 的版本号与 geckodriver 有没有兼容再说。这三个玩意儿互不兼容又是一大坑。
    Abblee
        8
    Abblee  
    OP
       2018-06-03 18:52:57 +08:00
    @Mavious 我直接降了版本
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5614 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 01:41 · PVG 09:41 · LAX 18:41 · JFK 21:41
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.