I am using selenium and want to use separate firefox profiles for 3 different scripts. Is this possible?
Not sure how you are executing your scripts, but when you instantiate your webdriver
object, you can specify a FirefoxProfile
as the firefox_profile
argument. This is done by creating a FirefoxProfile
object (example below) and providing the path to your target profile as the argument:
from selenium import webdriver
# ...
profile = webdriver.firefox.firefox_profile.FirefoxProfile('/path/to/your/profile')
driver = webdriver.Firefox(firefox_profile=profile)
To the best of my knowledge you can't modify the profile after the driver
has been instantiated (I could be wrong about this though - worth experimenting if that is what you need to do :) ). That being the case, in each of your scripts you would create a profile that pointed to the profile you want to use, and then instantiate the driver
with the firefox_profile
argument pointed to the profile
object created by FirefoxProfile
.