2014-11-14 78 views
1

使用Python 3.2(Cygwin中)和硒2.44和FF32(和FF33),Win8.1 64位下面的代碼廣東話負載簡檔和FF32 3.2

browser = webdriver.Firefox()

拋出錯誤

File "/usr/lib/python3.2/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 105, in _wait_until_connectable 
self.kill() 
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. 

我做錯了什麼?我搜索谷歌,並發現類似的問題,但所有專家建議將硒升級到最新,我已經這樣做了。我試圖用FF 24,28進行檢查,但無法解決。 PL幫我

回答

0

看起來像硒的配置文件路徑的處理是有問題的Cygwin中

臨時黑客是

在cygwin_dir \ LIB \ python3.2 \站點包\硒\ webdriver的\火狐\ firefox_binary.py ,按照以下路線替換路徑

def _start_from_profile_path(self, path): 
      self._firefox_env["XRE_PROFILE_PATH"] = Popen(["cygpath", "-w", path], stdout=PIPE).stdout.read().decode("utf-8").rstrip()