Question: First, I want to **use some addons** while selenium controlling my firefox.

So, i tried load **default profile** of firefox in selenium code.

My code:

```
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile

profile_path = r'C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\y1uqp5mi.default'
default_profile = FirefoxProfile(profile_path)

driver = webdriver.Firefox(service=service, options=options, firefox_profile=default_profile)

```

But, when i start the code, a **DeprecationWarning** happened: `firefox_profile has been deprecated, please pass in an Options object`

I search a lot and i don't think it's a difficult problem, but sadly i can't solve this problem finally, maybe my bad english encumber me... ...

Answer: 
Here is the documentation for this:
<https://www.selenium.dev/documentation/webdriver/capabilities/driver_specific_capabilities/#setting-a-custom-profile>

I tried this locally and it worked:

**EDITED**: I've changed the code, so there are no deprecation warnings

```
from selenium.webdriver import Firefox
from selenium.webdriver.firefox.service import Service
from selenium.webdriver.firefox.options import Options

profile_path = r'C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\y1uqp5mi.default'
options=Options()
options.set_preference('profile', profile_path)
service = Service(r'C:\WebDriver\bin\geckodriver.exe')

driver = Firefox(service=service, options=options)

driver.get("https://selenium.dev")

driver.quit()

```
I tried this

```
from selenium.webdriver.firefox.options import Options

profile_path = r'C:\Users\Administrator\AppData\Roaming\Mozilla\Firefox\Profiles\y1uqp5mi.default'
options=Options()
options.set_preference('profile', profile_path)
driver = Firefox(options=options)

```