How to load firefox profile with Python Selenium?

前端 未结 5 973
囚心锁ツ
囚心锁ツ 2021-02-14 20:19

I\'m trying to get Python Selenium to work on my Windows Machine. I\'ve upgraded to the latest versions of Firefox, Selenium, Geckodriver, but I still receive the below error: <

5条回答
  •  粉色の甜心
    2021-02-14 20:52

    Loading customized firefox profile in java:

    FirefoxOptions options = new FirefoxOptions();
    
    ProfilesIni allProfiles = new ProfilesIni();         
    FirefoxProfile selenium_profile = allProfiles.getProfile("selenium_profile"); // manualy created profile in firefox profile manager
    options.setProfile(selenium_profile);
    
    options.setBinary("C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe");
    System.setProperty("webdriver.gecko.driver", "C:\\Users\\pburgr\\Desktop\\geckodriver-v0.20.0-win64\\geckodriver.exe");
    driver = new FirefoxDriver(options);
    driver.manage().window().maximize();
    

提交回复
热议问题