How to configure Selenium to use multiple Firefox profiles?

I use selenium and want to use separate firefox profiles for 3 different scripts. Is it possible?

+1
source share
1 answer

You do not know how you execute your scripts, but when you instantiate an object webdriver, you can specify FirefoxProfileas an argument firefox_profile. This is done by creating an object FirefoxProfile(example below) and providing the path to your target profile as an argument:

from selenium import webdriver
# ...
profile = webdriver.firefox.firefox_profile.FirefoxProfile('/path/to/your/profile')
driver = webdriver.Firefox(firefox_profile=profile)

, , driver ( , , , :)). , , , driver firefox_profile, profile, FirefoxProfile.

+3

All Articles