我正在尝试使用Iceweasel在Debian6中安装Selenium。没有监视器,所以我安装了xvfb。这是我的代码:
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'发布于 2013-02-22 21:03:55
您使用的是哪个版本的Selenium?最新版本不支持Debian squeeze中的iceweasel。我一直在Firefox中使用Selenium,来自:
deb http://packages.linuxmint.com debian import它确实可以与最新的Selenium IDE一起工作。我还没有在xvfb中使用Selenium,但是如果您告诉我版本号,我可以测试一下。
注意:这不是现在的答案,但将是您给我的细节。我没有足够的代表。发表评论,很抱歉。
https://stackoverflow.com/questions/13788648
复制相似问题