Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP method not allowed when trying to capture console

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

like image 723
Mario Avatar asked Jun 25 '26 05:06

Mario


1 Answers

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

like image 196
Raphhh Avatar answered Jun 26 '26 19:06

Raphhh