Closed
Description
Description
Accessing the the driver.log_types
property when using Firefox doesn't work and returns an error.
Reproducible Code
from selenium import webdriver
driver = webdriver.Firefox()
print(driver.log_types)
Debugging Logs
DEBUG:selenium.webdriver.common.selenium_manager:Selenium Manager binary found at: /home/cgoldberg617/code/selenium/py/selenium/webdriver/common/linux/selenium-manager
DEBUG:selenium.webdriver.common.selenium_manager:Executing process: /home/cgoldberg617/code/selenium/py/selenium/webdriver/common/linux/selenium-manager --browser firefox --debug --language-binding python --output json
DEBUG:selenium.webdriver.common.selenium_manager:geckodriver not found in PATH
DEBUG:selenium.webdriver.common.selenium_manager:firefox not found in PATH
DEBUG:selenium.webdriver.common.selenium_manager:firefox not found in the system
DEBUG:selenium.webdriver.common.selenium_manager:Required browser: firefox 137.0
DEBUG:selenium.webdriver.common.selenium_manager:firefox 137.0 already exists
DEBUG:selenium.webdriver.common.selenium_manager:firefox 137.0 is available at /home/cgoldberg617/.cache/selenium/firefox/linux64/137.0/firefox
DEBUG:selenium.webdriver.common.selenium_manager:Required driver: geckodriver 0.36.0
DEBUG:selenium.webdriver.common.selenium_manager:geckodriver 0.36.0 already in the cache
DEBUG:selenium.webdriver.common.selenium_manager:Driver path: /home/cgoldberg617/.cache/selenium/geckodriver/linux64/0.36.0/geckodriver
DEBUG:selenium.webdriver.common.selenium_manager:Browser path: /home/cgoldberg617/.cache/selenium/firefox/linux64/137.0/firefox
DEBUG:selenium.webdriver.common.service:Started executable: `/home/cgoldberg617/.cache/selenium/geckodriver/linux64/0.36.0/geckodriver` in a child process with pid: 15157 using 0 to output -3
DEBUG:selenium.webdriver.remote.remote_connection:POST http://localhost:51515/session {'capabilities': {'firstMatch': [{}], 'alwaysMatch': {'browserName': 'firefox', 'acceptInsecureCerts': True, 'moz:debuggerAddress': True, 'pageLoadStrategy': <PageLoadStrategy.normal: 'normal'>, 'browserVersion': None, 'moz:firefoxOptions': {'binary': '/home/cgoldberg617/.cache/selenium/firefox/linux64/137.0/firefox', 'prefs': {'remote.active-protocols': 3}}}}}
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): localhost:51515
DEBUG:urllib3.connectionpool:http://localhost:51515 "POST /session HTTP/1.1" 200 0
DEBUG:selenium.webdriver.remote.remote_connection:Remote response: status=200 | data={"value":{"sessionId":"d80e7b29-4a89-48d8-9b77-2507968f7220","capabilities":{"acceptInsecureCerts":true,"browserName":"firefox","browserVersion":"137.0","moz:accessibilityChecks":false,"moz:buildID":"20250327043313","moz:debuggerAddress":"127.0.0.1:60083","moz:geckodriverVersion":"0.36.0","moz:headless":false,"moz:platformVersion":"6.6.67-06628-g571b599e617d","moz:processID":15160,"moz:profile":"/tmp/rust_mozprofileayiDc9","moz:shutdownTimeout":60000,"moz:webdriverClick":true,"moz:windowless":false,"pageLoadStrategy":"normal","platformName":"linux","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:137.0) Gecko/20100101 Firefox/137.0"}}} | headers=HTTPHeaderDict({'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-cache', 'content-length': '814', 'date': 'Mon, 07 Apr 2025 17:14:26 GMT'})
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
DEBUG:selenium.webdriver.remote.remote_connection:GET http://localhost:51515/session/d80e7b29-4a89-48d8-9b77-2507968f7220/se/log/types {}
DEBUG:urllib3.connectionpool:http://localhost:51515 "GET /session/d80e7b29-4a89-48d8-9b77-2507968f7220/se/log/types HTTP/1.1" 405 0
DEBUG:selenium.webdriver.remote.remote_connection:Remote response: status=405 | data=HTTP method not allowed | headers=HTTPHeaderDict({'content-type': 'text/plain; charset=utf-8', 'content-length': '23', 'date': 'Mon, 07 Apr 2025 17:14:30 GMT'})
DEBUG:selenium.webdriver.remote.remote_connection:Finished Request
Traceback (most recent call last):
File "/home/cgoldberg617/code/selenium/py/sel.py", line 22, in <module>
print(driver.log_types)
^^^^^^^^^^^^^^^^
File "/home/cgoldberg617/code/selenium/py/selenium/webdriver/remote/webdriver.py", line 1175, in log_types
return self.execute(Command.GET_AVAILABLE_LOG_TYPES)["value"]
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cgoldberg617/code/selenium/py/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "/home/cgoldberg617/code/selenium/py/selenium/webdriver/remote/errorhandler.py", line 196, in check_response
raise exception_class(value)
selenium.common.exceptions.WebDriverException: Message: HTTP method not allowed