Selenium Firefox user profile not working

I am trying to load my selenium firefox profile and I keep getting the error:

WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.

The code worked fine 15 minutes ago. I'm not sure what happened.

I have firefox 43.0.4 and selenium 2.49

This is my code that is causing the error:

profile = webdriver.FirefoxProfile()
driver = webdriver.Firefox(profile)

I am using Windows 7 Professional, Python 2.7.10 | Anaconda 2.3.0 (64-bit)

Traceback:

    Traceback (most recent call last):
  File "C:\Users\Moyp\dev\anaconda\lib\site-packages\IPython\core\interactiveshell.py", line 3035, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-15-37f7d14be053>", line 2, in <module>
    driver = webdriver.Firefox(profile)
  File "C:\Users\Moyp\dev\anaconda\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 77, in __init__
    RemoteWebDriver.__init__(self,
  File "C:\Users\Moyp\dev\anaconda\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 49, in __init__
    self.binary.launch_browser(self.profile)
  File "C:\Users\Moyp\dev\anaconda\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 68, in launch_browser
    self._wait_until_connectable()
  File "C:\Users\Moyp\dev\anaconda\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 103, in _wait_until_connectable
    raise WebDriverException("Can't load the profile. Profile "
WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
+4
source share
4 answers

Different versions of selenium have compatibility issues with some versions of Firefox. Selenium 2.49 and Firefox 43 work well together.

Make sure you really use selenium 2.49:

import selenium
print(selenium.__version__) 
+4
source

, , . . top , firefox .

+2

. Selenium profile = webdriver.FirefoxProfile(profilepath)...

+2

Selenium firefox, , URL, . ? , .

. .

0

Source: https://habr.com/ru/post/1624308/


All Articles