I am using selenium
and yaml
from a code got from a friend that creates a new Firefox profile every launch and I want to use my own profile, not a new profile
This is part of the code and i have been searching and trying everything to fix the problem but I couldn't figure out what to do more:
from selenium.webdriver.firefox.options import Options
from selenium import webdriver
import yaml
import os
with open("assets/config.yaml", "r") as config:
config = yaml.safe_load(config)
options = Options()
if config.get("settings").get("headless"):
options.headless = True
profile = webdriver.Firefox(executable_path=config.get("settings").get("firefox"), service_log_path=os.path.devnull if not config.get("settings").get("log") else config.get("settings").get("log"), options=options)
And this is the code from config.yaml:
settings:
headless: False
firefox: assets/geckodriver.exe
log: null
I've used it with Java, so in general maybe you can follow this steps:
Firefox.exe -p
which creates it in the "C:\Users\xUser\AppData\Roaming\Mozilla\Firefox\Profiles" asxyz.Selenium
.FirefoxProfile
class in the Python binding.