Python Selenium Webdriver错误:";Can';t加载配置文件“;

Python Selenium Webdriver错误:";Can';t加载配置文件“;,python,python-2.7,selenium,selenium-webdriver,webdriver,Python,Python 2.7,Selenium,Selenium Webdriver,Webdriver,我使用的是SeleniumWebDriver(Python绑定),我的脚本可以在Mac(OSX10.6.8)上运行,但不能在PC(Windows7Enterprise)上运行。下面是我得到的错误: C:\Python27>python myscript.py Traceback (most recent call last): File "myscript.py", line 303, in <module> myfunction(arg1) File "mys

我使用的是SeleniumWebDriver(Python绑定),我的脚本可以在Mac(OSX10.6.8)上运行,但不能在PC(Windows7Enterprise)上运行。下面是我得到的错误:

C:\Python27>python myscript.py
Traceback (most recent call last):
  File "myscript.py", line 303, in <module>
    myfunction(arg1)
  File "myscript.py", line 87, in myfunction
    browser = webdriver.Firefox(firefox_profile = fp)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\webdriver.py",
line 61, in __init__
    self.binary, timeout),
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\extension_conne
ction.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "C:\Python27\lib\site-packages\selenium\webdriver\firefox\firefox_binary.
py", line 61, in launch_browser
    self._wait_until_connectable()
  File "C:\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\\marzagao.1\\appdata\\local\\temp\\tmpnn0nhk Firefox out
put: "
我在谷歌上搜索了一下,显然这个错误消息可能有不同的原因。我尝试了这个解决方案,但没有成功(我想它不适用于我的情况,尽管错误消息类似)。有什么想法吗


(Windows 7 Enterprise、Service Pack 1、Python 2.7.5、Selenium 2.34、Firefox 23.0)

看起来Firefox 23还不受支持。 Selenium 2.34增加了对Firefox22的支持,现在已经发布了2.35,但是没有提到FF23

因此,我建议您将firefox降级到v22或尝试新的2.35 selenium库


它在mac上是如何工作的我不知道,你确定在那里运行ff23吗?

谢谢,Erki。那是一个月前的事了,但你说的有道理,也许我在OSX上运行ff22,在Windows上运行ff23。最后,我完全放弃了Firefox,完全重写了脚本,所以我现在无法轻松地重新测试它,但我会在某个时候回到这个问题上。
for download_folder in list_of_download_folders:

    fp = webdriver.FirefoxProfile()
    fp.set_preference("browser.download.folderList", 2)
    fp.set_preference("browser.download.manager.showWhenStarting", False)
    fp.set_preference("browser.download.dir", download_folder)
    fp.set_preference("browser.helperApps.neverAsk.saveToDisk", "text/plain")
    browser = webdriver.Firefox(firefox_profile = fp)

    # gets URL, download files