I am trying to run selenium python script using aws lambda. It runs locally. However on the cloud, it fails with the following error:
selenium.common.exceptions.TimeoutException: Message: Failed to read marionette port
Here is a code snippet
options.set_preference('profile', profile_path)
options.set_preference("browser.cache.disk.enable", False)
options.set_preference("browser.cache.disk.smart_size.enabled", False)
options.set_preference("browser.cache.disk.capacity", 0)
options.set_preference("browser.cache.memory.enable", False)
options.set_preference("browser.cache.offline.enable", False)
options.set_preference("network.http.use-cache", False)
options.set_preference('browser.cache.disk.parent_directory',
<a path to /tmp>)
options.binary_location = binary_location
service = Service(executable_path, log_path='/tmp/geckodriver.log')
firefox_driver = webdriver.Firefox(service=service, options=options)
Any suggestion would be appreciated.