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. [Hibernate] - many to one

    Hibernate的多对一操作: 例子参考引用: http://www.tutorialspoint.com/hibernate/hibernate_many_to_one_mapping.htm h ...

  2. 工作中简单又实用的vim配置

    set number syntax enable set tabstop=4 set shiftwidth=4 set noexpandtab set cindent set autoindent s ...

  3. nova分析(8)—— nova-compute

    nova-compute是管理和配置虚拟机的入口,在所有compute机器上都需要该服务来创建和管理虚拟机. nova-compute服务的入口在 nova.cmd.compute:main ,其启动 ...

  4. HackerRank "Lucky Numbers"

    Great learning for me:https://www.hackerrank.com/rest/contests/master/challenges/lucky-numbers/hacke ...

  5. bzoj3035: 导弹防御塔

    Description Freda的城堡——“Freda,城堡外发现了一些入侵者!”“喵...刚刚探究完了城堡建设的方案数,我要歇一会儿嘛lala~”“可是入侵者已经接近城堡了呀!”“别担心,rain ...

  6. bzoj3319: 黑白树

    Description 给定一棵树,边的颜色为黑或白,初始时全部为白色.维护两个操作:1.查询u到根路径上的第一条黑色边的标号.2.将u到v    路径上的所有边的颜色设为黑色.Notice:这棵树的 ...

  7. Linux下SSH的Log文件路径

    Redhat or Fedora Core: /var/log/secure # Mandrake, FreeBSD or OpenBSD: /var/log/auth.log # SuSE: /va ...

  8. xss攻击和sq注入

    xss攻击跟SQL注入的原理还是挺简单的,都是利用web是使用字符串进行操作的原理,通过伪造分隔符或者结束符号,来让网页或者服务端来运行输入的代码 一般防御的方法就是在对一些分隔符进行转义,djang ...

  9. 通过[蜘蛛协议]Robots.txt禁止搜索引擎收录的方法

      什么是robots.txt文件? 搜索引擎通过一种程序robot(又称spider),自动访问互联网上的网页并获取网页信息. 您可以在您的网站中创建一个纯文本文件robots.txt,在这个文件中 ...

  10. C语言中字符串常量到底存在哪了?

    常量存储总结局部变量.静态局部变量.全局变量.全局静态变量.字符串常量以及动态申请的内存区 1.局部变量存储在栈中2.全局变量.静态变量(全局和局部静态变量)存储在静态存储区3.new申请的内存是在堆 ...