ここを見て、python-seleniumバインディングをインストールしようとしています
次のコマンドをインポートしようとすると、以下のエラーが表示されます
from selenium.firefox.webdriver import WebDriver
結果:
from selenium.firefox.webdriver import WebDriver
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named firefox.webdriver
私はこれを解決するためにたくさん検索しましたが、これを行うための正しい例が得られませんでした。Pythonセレンバインディングをインストールする方法と上記のエラーが返される理由について誰かに教えてください。
前もって感謝します..........
編集済み: 以下の回答に従ってコードを編集し、次のことを試しました。以下を取得しました
>>> 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: *** LOG addons.xpi: startup\n*** LOG addons.xpi: checkForChanges\n*** LOG addons.xpi: Opening database\n*** LOG addons.xpi: No changes found\nFailed to dlopen /usr/lib/libX11.so.6\ndlerror says: /usr/lib/libX11.so.6: wrong ELF class: ELFCLASS32\n'
そしてまたあると言ってsome crash in firefox 1.0....