0

I'm trying to write a basic selenium script but cannot past the below error. I am using geckodriver 0.34, firefox 122.0.1, python 3.8.10 and Selenium 4.17.2

My code:

from selenium import webdriver  
from selenium.webdriver import FirefoxOptions
from selenium.webdriver.firefox.service import Service

#geckdriver 0.34
#firefox 122.0.1
#Selenium 4.17.2
#python 3.8.10

opts = FirefoxOptions()
opts.add_argument("--headless")
service = Service(executable_path='/home/**[redacted my name]**/.local/bin/geckodriver')
browser = webdriver.Firefox(service=service, options=opts)
browser.get("https://www.google.com/")
print("done")

I recieve this error when running my script

Traceback (most recent call last):
  File "/home/**[redacted my name]**/FPL/PlayerImport.py", line 14, in <module>
    browser = webdriver.Firefox(service=service, options=opts)
  File "/home/**[redacted my name]**/.local/lib/python3.8/site-packages/selenium/webdriver/firefox/webdriver.py", line 69, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/home/**[redacted my name]**/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 208, in __init__
    self.start_session(capabilities)
  File "/home/**[redacted my name]**/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 292, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/home/**[redacted my name]**/.local/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/home/**[redacted my name]**/.local/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Failed to decode response from marionette
2
  • Are you doing this in docker or no? Commented Feb 9, 2024 at 20:25
  • i am not using docker Commented Feb 10, 2024 at 9:18

1 Answer 1

0

I solved this issue by updating WSL to WSL2. I dont know why this worked but it did.

Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.