[Python] Navigate Firefox with Selenium

Discussão em 'Python' iniciado por Stack, Fevereiro 3, 2025.

  1. Stack

    Stack Membro Participativo

    I want to get to a particular session in firefox, so my login data is saved

    from selenium import webdriver

    profile_path = "/home/XXXX/.mozilla/firefox/XXXX.selenium1" # particular profile - I hid some part of the path for privacy reason

    options = webdriver.FirefoxOptions()
    options.add_argument(f"--profile={profile_path}")

    driver = webdriver.Firefox(options=options)
    driver.get(url)


    However, the get seems not to work. Firefox opens but I need to navigate to the page manually.

    Instead, if I do not use a profile, i.e.,

    from selenium import webdriver


    driver = webdriver.Firefox()
    driver.get(url)


    Firefox opens the right page... but of course, I am not logged in.

    I would like to get the first script to work.

    Continue reading...

Compartilhe esta Página