No module named 'selenium.webdriver.safari.options'

1.7k Views Asked by At
Requirements
OS macOS Monterey 12.3.1
Selenium version 4.1.1
Python 3.10
Safari 15.4 (17613.1.17.1.13)
from selenium.webdriver.safari.options import Options as SafariOptions
self.options = SafariOptions()

ModuleNotFoundError: No module named 'selenium.webdriver.safari.options'

and I can't use desired_capabilities in selenium4 because:

        if desired_capabilities:
        warnings.warn(
            "desired_capabilities has been deprecated, please pass in an Options object with options kwarg",
            DeprecationWarning,
            stacklevel=2
        )
2

There are 2 best solutions below

0
On BEST ANSWER

Safari Options was a known bug for Selenium 4 for Py.

This has been resolved - Py safari options #10385

This was merged into release 4.1.3 for Py, update your Selenium version to 4.1.3 or 4.1.4 to resolve the issue.

0
On

If you trying to install auto-gpt, I recommend you to create a new environment and execute requirement.txt file.This was the way I solved the issue.