2016-06-22 4 views
1

Pythonでセレンスクリプトを書いて、特定のWebサイトへの投稿を自動化しました。私は過去にそれを実行し、それは完璧に働いています。しかし、私はスクリプトを実行するために行って、今は突然以下を受け取っています。 私はそれが何とかロードするモジュールの問題だと思います。また、時々firefoxが開き、それ以外の時間は開きません。 MacでのLinux。Pythonセレンスクリプトからのトレースバックエラー(断続的に動作します)

SCRIPT:

from selenium import webdriver 
browser = webdriver.Firefox() 
browser.get('https://losangeles.craigslist.org/') 

がERROR:

/usr/bin/python2.7 /home/max/Desktop/CraigsList.py 
Traceback (most recent call last): 
    File "/home/max/Desktop/CraigsList.py", line 4, in <module> 
    browser = webdriver.Firefox() 
    File "/home/max/.local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 81, in __init__ 
    self.binary, timeout) 
    File "/home/max/.local/lib/python2.7/site-packages/selenium/webdriver/firefox/extension_connection.py", line 51, in __init__ 
    self.binary.launch_browser(self.profile, timeout=timeout) 
    File "/home/max/.local/lib/python2.7/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 68, in launch_browser 
    self._wait_until_connectable(timeout=timeout) 
    File "/home/max/.local/lib/python2.7/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. 

答えて

0
  1. は、あなたが実行Pythonスクリプトに使用するのと同じユーザーとパス
  2. webdriverを
  3. ためのセットアップLOG_FILEと、コンソールで実行するFFを試してみてください
  4. 多分PhantomJSドライバをお勧めしますか?
関連する問題