2016-07-01 12 views
1

私はこれが何か簡単だと思っています。しかし、それは私の脇にあります。 私はSeleniumの新しいスターターです。ウェブサイトから情報を自動的に抽出したいのですが、これは良い方法のようです。 私はWindows 10でこれをやり始めました。私はPythonでプログラムを使いたいので、PyCharmを使用しています。私は次のようにPythonのコマンドラインシェルを使用する場合、私はpip install seleniumを使用してセレンをインストールしていますSelenium webdriver.Firefox()は呼び出し可能ではありません

from selenium import webdriver 
driver = webdriver.Firefox() 

私は、次のエラーメッセージが出ます:

Python 3.5.1 (v3.5.1:37a07cee5969, Dec 6 2015, 01:38:48) [MSC v.1900 32 bit (Intel)] on win32 
Type "help", "copyright", "credits" or "license" for more information. 
>>> from selenium import webdriver 
>>> driver = webdriver.Firefox() 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 81, in __init__ 
self.binary, timeout) 
    File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 51, in __init__ 
self.binary.launch_browser(self.profile, timeout=timeout) 
    File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser 
self._wait_until_connectable(timeout=timeout) 
    File "C:\Users\Damo\AppData\Local\Programs\Python\Python35-32\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 98, in _wait_until_connectable 
raise WebDriverException("The browser appears to have exited " 
selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details. 

を私はPyCharm内の同じを入力すると、IDEが伝えます私がこの用語webdriver.Fiefoxの結果はFirefox is not callable

何かをインストールできませんでしたか?

愚かな反応を意味するものではありません

>

+0

Firefoxをバージョン45にダウングレードしてスクリプトを再実行することはできますか?また、firefoxの設定を無効にして、自動更新します。 –

+0

私はFirefox 45.0に戻り、 'webdriver.Firefox()'コマンドはFirefoxウィンドウを起動するようになりました。これは、SeleniumとFirefox 47の間に問題があることを意味しますか? – fatherdamo

+0

私は答えがあると思う[ここ](http://stackoverflow.com/questions/37761668/cant-open-browser-with-selenium-after-firefox-update)。私は明日それを正しく見て、私は今日は少し忙しいです。 – fatherdamo

答えて

0

ができますが、Firefoxの最新バージョンがマシンにインストールされているのですか?

+0

私はそう信じています、Firefox 47.0は数週間前にインストール/アップデートされました。 – fatherdamo

関連する問題