from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument('-profile')
options.add_argument('D:/путь_куда_сохранить/профиль')
driver = webdriver.Firefox(options=options,
executable_path='geckodriver.exe',
service_args=['--marionette-port', '2828'])