按网上教程搭建好环境后,执行下面的代码出现了错误:

测试代码如下:

from selenium import webdriver
driver=webdriver.Firefox()
driver.get("http://www.baidu.com")

错误信息如下:

Traceback (most recent call last):
File "D:\pcode\24.py", line 2, in <module>
driver=webdriver.Firefox()
File "D:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py",
line 59, in __init__
self.binary, timeout),
File "D:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_conne
ction.py", line 47, in __init__
self.binary.launch_browser(self.profile)
File "D:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.
py", line 61, in launch_browser
self._wait_until_connectable()
File "D:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.
py", line 105, in _wait_until_connectable
self.profile.path, self._get_firefox_output()))
selenium.common.exceptions.WebDriverException: Message: "Can't load the profile.
Profile Dir: c:\\users\\admin\\appdata\\local\\temp\\tmp5jpwrx Firefox output
: *** LOG addons.xpi: startup\r\n*** WARN addons.xpi: Ignoring missing add-on in

解决办法:卸载28版本的Firefox,安装24版本的

网上其他人推荐的办法:pip install -U selenium

Selenium + Python + Firefox的更多相关文章

  1. selenium + python + firefox 测试环境的搭建与配置

    对于做UI自动化,如果是纯编写一段自动化测试程序,那么后续的维护成本会较高.这种情况下,借助 selenium 这款自动化系测试工具,辅助于自己编写部分脚本,将是个不错的选择.selenium 本身支 ...

  2. Selenium+python+shell+crontab+firefox

    最近在尝试一个自动打卡的脚本,发现了几个问题,特此记录一下. 环境: Ubuntu 12.04.4 LTS selenium 2.43.0 firefox 32.0.3 1 本来机器上selenium ...

  3. python中用selenium调Firefox报错问题

    python在用selenium调Firefox时报错: Traceback (most recent call last):  File "G:\python_work\chapter11 ...

  4. Selenium+Python:下载文件(Firefox 和 Chrome)

    引自  https://blog.csdn.net/Momorrine/article/details/79794146 1.      环境 操作系统 Win10 IDE Eclipse (Oxyg ...

  5. 7.解决在python中用selenium启动FireFox浏览器启动不了的方法

    首次在利用python中的selenium启动FireFox浏览器时可能碰到如下问题 当输入如下代码时: from selenium import webdriver brower=webdriver ...

  6. Selenium启动Firefox示例(python版)

    目前做selenium自动化使用的主流语言分为java和python,前一篇为java版,本篇介绍python实现selenium启动Firefox. 1 #-*- coding:utf-8 -*- ...

  7. selenium + python自动化测试环境搭建

    selenium的在python平台的搭建: 搭建平台windows 准备工具如下: --------------------------------------------------------- ...

  8. Page Object Model (Selenium, Python)

    时间 2015-06-15 00:11:56  Qxf2 blog 原文  http://qxf2.com/blog/page-object-model-selenium-python/ 主题 Sel ...

  9. selenium和Firefox版本不兼容

    selenium8.py coding = utf-8 from selenium import webdriver driver = webdriver.Firefox() driver.get(' ...

随机推荐

  1. Linux命令:findutils

    本篇介绍Linux中常用的文件查找和定位工具,包括:find.locate.which.xargs等. GNU find 命令参考<https://www.gnu.org/software/fi ...

  2. 在升级过内核的机器上安装docker遇到的一个错误

    出现了以下错误: [root@osd2 ~]# service docker start Starting cgconfig service: Error: cannot mount memory t ...

  3. 深入Spring Boot:怎样排查expected single matching bean but found 2的异常

    写在前面 这个demo来说明怎么排查一个常见的spring expected single matching bean but found 2的异常. https://github.com/hengy ...

  4. Extjs4 自定义颜色选择器ColorField

    使用元素的颜色选择器 Ext.create("Ext.picker.Color",{ renderTo:Ext.getBody(), listeners:{ select:func ...

  5. ORACLE数据库 常用命令和Sql常用语句

    ORACLE 账号相关 如何获取表及权限 1.COPY表空间backup scottexp登录管理员账号system2.创建用户 create user han identified(认证) by m ...

  6. KJMusic完整音乐项目

    KJMusic完整音乐项目 KJMusic是一个完整音乐项目,这个项目从欢迎页面到首页以及音乐播放页面都做得非常不错.并且本音乐支持本地音乐,和音乐电台,支持切换上下首个.本项目还支持侧滑出现menu ...

  7. Android 抓取LOG的几种命令【转】

    通常调试时候需要抓取log信息,下面几种通过ADB命令来抓取log的方法: USB连接上手机,手机需要其他操作:然后运行ADB工具:输入不同的命令即可抓取对应的LOG信息. 抓取radio LOG信息 ...

  8. hdu1799-循环多少次?-(组合恒等式)

    循环多少次? Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Subm ...

  9. 实例的render方法渲染组件

    1.普通渲染组件 在app容器中插入login组件 <login></login>  一个app可以多个这种组件 <script> var login = { te ...

  10. Excel 如何快速切换到最后一行

    1.快速切换到最后一行,是ctrl+↓箭头(来源:百度) 2. http://www.office68.com/excel/22936.html     一.定位到第一个单元格        方法1: ...