[PYTHON] Selenium + Firefox 47+ Can't load the profile. Error handling

python


from selenium.webdriver import Firefox
driver = Firefox()
driver.get('http://example.com')

When you do

Correspondence that the error Can't load the profile. appears. mac.

Is Selenium not compatible with the marionette marionette environment configuration system (?) That comes with Firefox 47?

Install geckodriver with brew.

command


$ brew install geckodriver
$ pip install -U selenium

python


firefox_capabilities = DesiredCapabilities.FIREFOX
firefox_capabilities['marionette'] = True

driver = webdriver.Firefox(capabilities=firefox_capabilities)
driver.get('http://example.com')

This is OK

Reference: Can't open browser with Selenium after Firefox update --Stack Overflow

Postscript

afterwards,

selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 

Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.firefox.service.Service object at 0x109a96690>> ignored

If this comes out

python


import os
if "/usr/local/bin" not in os.environ['PATH']:
    os.environ['PATH'] += os.pathsep + "/usr/local/bin"

Recommended Posts

Selenium + Firefox 47+ Can't load the profile. Error handling
I can't get the element in Selenium!
I can't click the Selenium checkbox Python VBA
Mainframe error handling
Python Error Handling
SikuliX error handling
django.db.migrations.exceptions.InconsistentMigrationHistory error handling