Selenium + Python + Firefox
2014-05-07 16:29
323 查看
按网上教程搭建好环境后,执行下面的代码出现了错误:
测试代码如下:
错误信息如下:
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
测试代码如下:
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 用Webdrive打开Firefox不含有插件的问题(python)
- selenium3+python2.7启动Firefox 53提示:socket.error: [Errno 10054]
- mac os+selenium2+Firefox驱动+python3
- selenium之python自动化测试系列:使用chrome或firefox的已存在的cookie访问网站
- selenium3+python2.7启动Firefox53提示:KeyError: 'sessionId'
- python中使用selenium调用Firefox缺少geckodriver解决方法
- python selenium环境配置Firefox和Chrome
- 关于selenium 用Webdrive打开Firefox不含有插件的问题(python)
- selenium之python自动化测试系列:使用chrome或firefox的已存在的cookie访问网站
- selenium+Python+firefox动手实践一
- selenium, firefox, python环境搭建指南
- python + selenium2 如何自定义firefox读取配置文件
- 用python+selenium+firefox爬取动态网页
- Selenium-解决使用Webdrive打开Firefox不含有插件的问题(python)
- Firefox37.0.1+selenium 2.53+python3.6打开浏览器时报错NameError: name 'basestring' is not defined
- python selenium firefox 添加cookie add_cookie
- selenium+Python测试,Firefox v49版本报错解决方案
- selenium+Python+firefox动手实践二
- selenium+python+firefox解决不安全连接的方法