5

I am trying to capture the console log of Firefox using Selenium but I am getting "HTTP method not allowed" error

This is how I am doing it currently:

from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities

# enable browser logging
d = DesiredCapabilities.FIREFOX
d['loggingPrefs'] = {'browser': 'ALL'}
driver = webdriver.Firefox(capabilities=d)
# load some site
driver.get('url')
# print messages
for entry in driver.get_log('browser'):
    print entry

The error I am getting is selenium.common.exceptions.WebDriverException: Message: HTTP method not allowed

Mario
  • 1,374
  • 6
  • 22
  • 48
  • Does this answer your question? [Selenium: Trying to get Firefox console logs results in "WebDriverError: HTTP method not allowed"](https://stackoverflow.com/questions/59192232/selenium-trying-to-get-firefox-console-logs-results-in-webdrivererror-http-me) – Yogev Neumann Dec 14 '20 at 08:13

1 Answers1

6

get_log is not implemented by Firefox driver. See https://github.com/mozilla/geckodriver/issues/330

Raphhh
  • 84
  • 1
  • 4