簡體   English   中英

Firefox WebDriver的實例不是使用selenium python綁定創建的

[英]Instance of Firefox WebDriver is not created with selenium python bindings

我安裝了selenium-python綁定並嘗試創建一個firefox web驅動程序實例,如下所示

>>> from selenium import webdriver
>>> driver = webdriver.Firefox()

我不知道這里有什么錯,它顯示以下錯誤

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/webdriver.py", line 51, in __init__
    self.binary, timeout),
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 44, in launch_browser
    self._wait_until_connectable()
  File "/usr/lib/python2.7/site-packages/selenium-2.21.3-py2.7.egg/selenium/webdriver/firefox/firefox_binary.py", line 81, in _wait_until_connectable
    self._get_firefox_output())
selenium.common.exceptions.WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: Error: cannot open display: :1100\n' 

可以任何請讓我知道如何解決這個問題.............

錯誤顯示“無法打開顯示:: 1100”。 你在遠程終端上運行它嗎? 確保您可以在提示符下鍵入“firefox”並打開瀏覽器(這就是Webdriver所做的 - 在您的系統上打開Firefox,然后嘗試連接到它)。 如果您在遠程系統上運行它,請在遠程連接到X顯示器時進行Web搜索。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM