selenium8.py

coding = utf-8

from selenium import webdriver
driver = webdriver.Firefox()
driver.get('http://www.baidu.com')
print (driver.title)
driver.quit()

运行报错:

Python 3.3.5 (v3.3.5:62cf4e77f785, Mar 9 2014, 10:37:12) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

================================ RESTART ================================

Traceback (most recent call last):
File "C:\Python33\selenium8.py", line 3, in
driver = webdriver.Firefox()
File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\webdriver.py", line 59, in init
self.binary, timeout),
File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\extension_connection.py", line 47, in init
self.binary.launch_browser(self.profile)
File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\firefox_binary.py", line 66, in launch_browser
self._wait_until_connectable()
File "C:\Python33\lib\site-packages\selenium-2.45.0-py3.3.egg\selenium\webdriver\firefox\firefox_binary.py", line 105, in _wait_until_connectable
raise WebDriverException("Can't load the profile. Profile "
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.

估计很多朋友都遇到过啊,网上搜了下是版本问题。
我的selenium版本是selenium-2.45.0,安装的fireFox最新的47版本,结果就报错了。
fireFox更新的快,但是selenium总是慢半拍。
反正现在是学习嘛,换FireFox版本吧
也不知道selenium-2.45.0,到底支持哪个版本的FireFox,百度搜索到一篇之前的文章说selenium-2.45.0,新发布了,支持FireFox36
一下子降低了11个版本号,好吧,反正是学习。
卸载新的FireFox,安装了36的版本。

接着运行:

================================ RESTART ================================

百度一下,你就知道

看来是通过了。
那么接下来就是学习selenium了,嘿嘿。又前进了一步!!

selenium和Firefox版本不兼容的更多相关文章

  1. 解决selenium与firefox版本不兼容问题

    Python环境下类比 个人使用 32位环境 Python 2.7.12 Selenium 2.53.6 Firefox 47.01 安装selenium可用pip选择对应版本,参考另一教程. 因为在 ...

  2. selenium与firefox版本不兼容

    报错信息: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port ...

  3. 解决selenium和FireFox版本不兼容问题

    相信很多同学刚接触selenium时,在Eclipse中打开fireFox浏览器时会报错:org.openqa.selenium.firefox.NotConnectedException: Unab ...

  4. selenium 与 firefox版本不兼容报错

    org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 ...

  5. Selenium2学习-007-WebUI自动化实战实例-005-解决 Firefox 版本不兼容:org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary

    此文主要讲述 Java 运行 Selenium 脚本时,因 Friefox 浏览器版本与 selenium-server-standalone-x.xx.x.jar 不兼容引起的 org.openqa ...

  6. 解决Selenium与firefox浏览器版本不兼容问题

    因为在用java打开firefox浏览器的时候报错 org.openqa.selenium.firefox.NotConnectedException: Unable to connect to ho ...

  7. Selenium firefox 版本问题

    问题:Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms 原因: selenium-server-standalone-x. ...

  8. selenium ide几个版本和对应的firefox版本

    最近安装selenium ide折腾了好久,可能是目前还不太熟悉自动化脚本录制的一些知识. 通过最新版firefox59安装的selenium ide 3.0.2录制的脚本不能导出.于是下载了低版本的 ...

  9. selenium启动firefox、ie、chrome各浏览器方法

    1.启动firefox浏览器 a.如果你的本地firefox是默认路径安装的话,如下方式即可启动浏览器 WebDriver driver = new FirefoxDriver(); driver.g ...

随机推荐

  1. php 导出csv文件

    <?php $sql = "select * from members_sqzj order by id asc"; $result = $db->fetch_All( ...

  2. json 解析

    纠结了两天的json数组反序列化,终于在同事的帮助下,找到方法了,特作笔记如下: using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Sy ...

  3. 深入了解iPad上的MouseEvent【转】

    iPad上没有鼠标,所以手指在触发触摸事件(TouchEvent)的时候,系统也会产生出模拟的鼠标事件(MouseEvent).     这对于普通网页的浏览需求而言,基本可以做到与PC端浏览器无明显 ...

  4. windows证书地址

    C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\MachineKeys 用certutil -sto ...

  5. bzoj2467: [中山市选2010]生成树

    Description 有一种图形叫做五角形圈.一个五角形圈的中心有1个由n个顶点和n条边组成的圈.在中心的这个n边圈的每一条边同时也是某一个五角形的一条边,一共有n个不同的五角形.这些五角形只在五角 ...

  6. iMac一体机安装苹果和Win7双系统

    前几天,有个客户说有一苹果的一体机,想装苹果和Win7双系统.约好了时间,带上工具就过去了.去的路上,用手机上网查了一下苹果电脑装双系统的过程.虽然以前也有给苹果的电脑安装过双系统,但次数不多而且时间 ...

  7. C语言每日一题之No.1

    鉴于在学校弱弱的接触过C,基本上很少编程,C语言基础太薄弱.刚好目前从事的是软件编程,难度可想而知.严重影响工作效率,已无法再拖下去了.为此,痛下决心恶补C语言.此前只停留在看书,光看好像也记不住,C ...

  8. .NET常用方法收藏

    1.过滤文本中的HTML标签 /// <summary> /// 清除文本中Html的标签 /// </summary> /// <param name="Co ...

  9. 安装ORACLE后,改变计算机名称,导致OracleDBConsoleOrcl服务无法启动

    错误信息: 启动oracledbconsoleorcl 服务提示 -- “--Windows不能再本地计算机启动oracledbconsoleorcl  有关更多信息,查阅系统事件日志,如果这是非Mi ...

  10. 【转】SQL SERVER标量表达式的隐式转换

    在SQL Server中的数据类型中,存在着优先级的问题.标量表达示的返回结果类型也会根据操作数的类型而定,如1 +'1'=2.而不是'11',因些Int型的优先级比VARCHAR型的优先级要高.所以 ...