zoukankan      html  css  js  c++  java
  • Selenium + Python + Firefox

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

    测试代码如下:

    from selenium import webdriver
    driver=webdriver.Firefox()
    driver.get("http://www.baidu.com")
    

    错误信息如下:

    Traceback (most recent call last):
    File "D:pcode24.py", line 2, in <module>
    driver=webdriver.Firefox()
    File "D:Python27libsite-packagesseleniumwebdriverfirefoxwebdriver.py",
    line 59, in __init__
    self.binary, timeout),
    File "D:Python27libsite-packagesseleniumwebdriverfirefoxextension_conne
    ction.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
    File "D:Python27libsite-packagesseleniumwebdriverfirefoxfirefox_binary.
    py", line 61, in launch_browser
    self._wait_until_connectable()
    File "D:Python27libsite-packagesseleniumwebdriverfirefoxfirefox_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 *** WARN addons.xpi: Ignoring missing add-on in

    解决办法:卸载28版本的Firefox,安装24版本的

    网上其他人推荐的办法:pip install -U selenium

  • 相关阅读:
    svn出现黄色感叹号怎么办
    数据库设计三大范式
    windows server2008R2 64位 配置 mysql-8.0.15-winx64
    sqlquerystress
    锁表操作
    微软专用消息队列msmq的简单使用
    数据库上移和下移
    mvc全局时间输出格式化处理
    webapi jsonp处理
    泛型处理ToEntity
  • 原文地址:https://www.cnblogs.com/xiaobaichuangtianxia/p/3714076.html
Copyright © 2011-2022 走看看