title: Getting console.log output from Firefox with Selenium
body: <p>I'm trying to get a web page's <code>console.log</code> output from Firefox via the python Selenium API bindings.  Based on the <a href="https://stackoverflow.com/questions/20907180/getting-console-log-output-from-chrome-with-selenium-python-api-bindings">code for Chrome</a>, and some <a href="https://code.google.com/p/selenium/wiki/DeveloperTips#Getting_output_from_the_error_console_to_a_file" rel="noreferrer">advice from the documentation</a>, I tried the following:</p>
  
  <pre><code>from selenium import webdriver
  from selenium.webdriver.common.desired_capabilities import DesiredCapabilities   
  d = DesiredCapabilities.FIREFOX
  d['loggingPrefs'] = { 'browser':'ALL' }
  fp = webdriver.FirefoxProfile()
  fp.set_preference('webdriver.log.file', '/tmp/firefox_console')
  driver = webdriver.Firefox(capabilities=d,firefox_profile=fp)
  driver.set_window_size(1280,1024)
  driver.get('http://foo.com')
  try:
      WebDriverWait(driver,10).until(lambda driver: driver.execute_script("return document.readyState") == "complete")
      for entry in driver.get_log('browser'):
          print entry
  finally:
      driver.quit()
  </code></pre>
  
  <p>But, for even a simple example page that calls <code>console.log("foo")</code>, I don't see <code>"foo"</code> either in the log entries returned via the API or in the <code>/tmp/firefox_console</code> file.  Am I doing something wrong?  Or is this a Selenium limitation?  </p>