Normally this would do
from selenium import webdriver from selenium.webdriver.firefox.webdriver import FirefoxProfile profile = FirefoxProfile("C:\\Path\\to\\profile") driver = webdriver.Firefox(profile)
As some of the options, such as firefox_profile and options.profile are mutually exclusive, precedence is given from how specific the setting is. capabilities is the least specific keyword argument, followed by options, followed by firefox_binary and firefox_profile.
In practice this means that if firefox_profile and options.profile are both set, the selected profile instance will always come from the most specific variable. In this case that would be firefox_profile. This will result in options.profile to be ignored because it is considered a less specific setting than the top-level firefox_profile keyword argument. Similarily, if you had specified a capabilities[“moz:firefoxOptions”][“profile”] Base64 string, this would rank below options.profile.
Can't see your entire code but looks like you have your answer in the above
Read it all here:- https://selenium-python.readthedocs.io/api.html?highlight=profile#module-selenium.webdriver.firefox.webdriver