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

测试代码如下:

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. vim主题设定

    Vim的颜色主题在/usr/share/vim/vim74/colors文件夹里. 打开vim后在normal模式下输入“:colorscheme”查看当前的主题,修改主题使用命令“:colorsch ...

  2. linux 一个读写锁的异常导致的故障

    环境信息: WARNING: kernel version inconsistency between vmlinux and dumpfile KERNEL: vmlinux-47.90 DUMPF ...

  3. 【剑指offer】单链表尾部插入一个节点

    #include <iostream> using namespace std; //链表结构体 struct ListNode { int m_Value; ListNode *next ...

  4. gitbash上使用tree

    gitbash上使用tree vscode从cmd设置gitbash之后,想在使用windows下的tree命令发现运行不了,有两种解决方案. 1,在gitbash上cmd //c tree,就等同c ...

  5. delphi控制本计算机和远程计算机关机等

    unit mainunit; {远程关机源码} interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Con ...

  6. 电子表格Excel

    电子表格Excel 本次课内容一.认识下Excel1.扩展名 office2007以前,扩展名是xls office2007,扩展名是xlsx 2.文件扩展名是xls或xlsx的文件,excel电子表 ...

  7. C++ CTreeview的checkbox使用方法

    1. 消息事件   (1)鼠标点击当前ITEM的CHECKBOX:引发NM_CLICK事件并传递TVHT_ONITEMSTATEICON.   (2)鼠标点击当前ITEM的TEXT:引发NM_CLIC ...

  8. Kotlin系列之序列(Sequences)源码完全解析

    Kotlin系列之序列(Sequences)源码完全解析 2018年06月05日 22:04:50 mikyou 阅读数:179 标签: Kotlin序列(sequence)源码解析Androidja ...

  9. vue分页 点击(非下拉)

    1.主页面 <template> <div class="list"> <template v-if="count"> 55 ...

  10. Spring集成MyBatis的使用-使用Mapper映射器

    Spring集成MyBatis使用 前面复习MyBatis时,发现在测试时,需要手动创建sqlSessionFactory,Spring将帮忙自动创建sqlSessionFactory,并且将自动扫描 ...