Skip to content

[🚀 Feature]: Linux Python Firefox restore previous session #8

@Benjamin-Loison

Description

@Benjamin-Loison

Feature and motivation

Python script trying to leverage Firefox argument -profile:
from selenium import webdriver
from selenium.webdriver.firefox.options import Options

options = Options()
options.add_argument('-profile')
options.add_argument('selenium_firefox_profile')
browser = webdriver.Firefox(options = options)
browser.get('about:support')
browser.quit()
Output:
Traceback (most recent call last):
  File "<tmp 3>", line 17, in <module>
    browser = webdriver.Firefox(options = options)
  File "/home/benjamin/venv/lib/python3.12/site-packages/selenium/webdriver/firefox/webdriver.py", line 71, in __init__
    super().__init__(command_executor=executor, options=options)
  File "/home/benjamin/venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
    self.start_session(capabilities)
  File "/home/benjamin/venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
    response = self.execute(Command.NEW_SESSION, caps)["value"]
  File "/home/benjamin/venv/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/home/benjamin/venv/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: Failed to set preferences: unknown error

Source: the Stack Overflow answer 76679586

/home/benjamin/selenium_firefox_profile faces the same issue.

Would help Improve_websites_thanks_to_open_source/issues/1019.

Related to #3.

https://www.selenium.dev/documentation/webdriver/drivers/ does not help.

Usage example

Not read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions