0

I am having trouble loading the default firefox profile using python-selenium. Here is my code:

from selenium import webdriver
profile = webdriver.FirefoxProfile("/home/Rudder_Analytics/.mozilla/firefox/79z12gvt.default")
driver = webdriver.Firefox()
BASEURL = "https://sellercentral.amazon.com/"
driver.get(BASEURL)
print driver.title
driver.close()

Not sure what is going wrong. I am giving path of the profile directory as mentioned in this link.

Subhash Deshmukh
  • 350
  • 3
  • 18
  • What is your Selenium version? – undetected Selenium Nov 15 '17 at 05:21
  • @DebanjanB The selenium version I am using is Selenium-3.3.3. I also noticed that even though the selenium may not be able to load the default profile as it is but it seems to be copying the profile and loading it as a new profile with random name. Is my observation correct? Anyways I am able to achieve my objective. – Subhash Deshmukh Nov 15 '17 at 07:56
  • I think I am able to achieve what I want with loading the default profile. which is getting copied into the new random profile. i.e. If my firefox default profile is 2234234z.default then it is copied into 34isdfi.temp like that. – Subhash Deshmukh Nov 20 '17 at 13:46
  • In short, above code is working fine. I just wanted to know how it works.:) – Subhash Deshmukh Nov 20 '17 at 14:02

1 Answers1

1

the example you linked isnt the same as you have it up there. you missed one things

fp = webdriver.FirefoxProfile('C:/Users/<user name>/AppData/Roaming/Mozilla/Firefox/Profiles/abc3defghij2.ProfileName')
driver = webdriver.Firefox(fp)`

what you should have done is

profile = webdriver.FirefoxProfile("/home/Rudder_Analytics/.mozilla/firefox/79z12gvt.default")
driver = webdriver.Firefox(profile)

You should have placed the profile variable into the webdriver.Firefox(profile) before its placed into the driver variable.

K. Abhulimen
  • 137
  • 1
  • 13