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

测试代码如下:

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. Java面试题_简答题

    作为一个大三在校生,很快就要去实习了,但总感觉自己连一个刚入门的菜鸟都不如,哎.发现自己连那个程序员的门槛都还没进,有点小伤心,不过伤心没用,努力向前才是我们现在应该做的事情. 下面是我之前在学校所从 ...

  2. Py designer 小程序实现实例

    前提 1.已安装Python(环境Win7+Python 2.7.12 ) 2.已安装插件pyqt4(插件获取路径:https://pan.baidu.com/s/1i50wAOH) 步骤 1.打开p ...

  3. ASP.NET HTTP 协议

    http是无状态的,不会记得“上个请求***”,所以哪怕是同一个页面中的js.css.jpg也都要重复的提交Accept-Language.Accept-Encoding.Cookie等. 一般情况下 ...

  4. react native 中es6语法解析

    react native是直接使用es6来编写代码,许多新语法能提高我们的工作效率 解构赋值 var { StyleSheet, Text, View } = React; 这句代码是ES6 中新增的 ...

  5. 侧边栏收起展开效果,onmouseover,onmouseout

    //方法一<!doctype html> <html lang="en"> <head> <meta charset="UTF- ...

  6. 限制ssh登录ip和系统用户

    一般对于安全性要求比较高的系统,限制ssh登录的源ip地址和可以登录的系统账户是非常有必要的,ssh登录的源地址和可以登录的系统账户的设置在sshd的配置文件/etc/ssh/sshd_config中 ...

  7. ELK日志平台

    1.ELK平台能够完美的解决我们上述的问题,ELK由ElasticSearch.Logstash和Kibana三个开源工具组成,不过现在还新增了一个Beats,它是一个轻量级的日志收集处理工具(Age ...

  8. SAP 优缺点

    1.优点: SAP是全球所有ERP产品中对企业构架和财务控制考虑得最细致的系统,也是整体控制逻辑和整体系统结构是最严谨的系统,可以让企业引进先进的管理理念: 对产品在各种行业的适用性考虑得最多的系统, ...

  9. vc for python2.7

    https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

  10. vue路由传参

    console.log( _this.$route.params.id)接收参数 <div class="baoming"><router-link :to=&q ...