I am currently working on a web scraping project on aws lambda (serverless)
techs :
python3
selenium 3.14
geckodriver-V0.29
firefox 80.0 (en mode headless)
Here is the code I implemented (knowing that I configured the paths for firefox and geckodriver beforehand) :
from selenium import webdriverfrom selenium.webdriver.firefox.options import Options as FirefoxOptionsfrom selenium.webdriver.firefox.firefox_binary import FirefoxBinaryoptions = FirefoxOptions()options.add_argument("--headless")binary = FirefoxBinary("/tmp/bin/firefox/firefox")webdriver.Firefox(options=options,executable_path="/tmp/bin/geckodriver", firefox_binary=binary)
This is the error I get:
Message: Process unexpectedly closed with status 255: WebDriverExceptionTraceback (most recent call last): File "/var/task/src/lambda_function.py", line 8, in lambda_handler driver = WebDriverWrapper() File "/var/task/src/webdriver_wrapper.py", line 116, in __init__ self._driver = webdriver.Firefox(options=options,executable_path="/tmp/bin/geckodriver", firefox_binary=binary) File "/var/task/lib/selenium/webdriver/firefox/webdriver.py", line 174, in __init__ keep_alive=True) File "/var/task/lib/selenium/webdriver/remote/webdriver.py", line 157, in __init__ self.start_session(capabilities, browser_profile) File "/var/task/lib/selenium/webdriver/remote/webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "/var/task/lib/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response) File "/var/task/lib/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace)selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 255
I have searched the forums and articles but have not found a solution. Has anyone experienced this kind of problem and if possible how to correct it?