2012-12-09 38 views
0

我正在嘗試使用Iceweasel在Debian 6中安裝Selenium。沒有顯示器,所以我安裝了xvfb。這是我的代碼:無法使用Iceweasel初始化網絡驅動程序

from selenium import webdriver 
import os 

os.environ["DISPLAY"]=":56017" 

url = "www.python.com" 

driver = webdriver.Firefox() 
driver.implicitly_wait(30) 
driver.get(url) 
text = driver.page_source 
driver.quit() 

driver = webdriver.firefox()返回此錯誤:

WebDriverException: Message: 'Can\'t load the profile. Profile Dir: 
/tmp/tmp8R_yRq Firefox output: Xlib: extension "RANDR" missing on display ": 
56017.0".\n*** e = 
[Exception... "Component returned failure code: 0x80570016 
(NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]" nsresult: 
"0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE)" location: "JS frame :: chrome: 
//browser/content/utilityOverlay.js :: getShellService :: line 312" data: no] 
\n' 
+0

檢查是否有幫助 http://support.mozilla.org/zh-CN/questions/784936 – Hemanth

回答

1

硒哪個版本您使用的?最新的版本在Debian擠壓中不適用於iceweasel。我一直在使用Selenium和Firefox:

deb http://packages.linuxmint.com debian import 

它確實與最新的Selenium IDE一起工作。我沒有用xvfb使用Selenium,但是我可以測試你是否告訴我版本號。

注意:這不是現在的答案,但會是當你給我的細節。我沒有足夠的代表。發表評論,對不起。

相關問題