trying to run a lambda on AWS that uses selenium and chromedriveruploaded a layer that contains selenium v4.13 and chromedriver v2.24I understand that this version of selenium contains selenium manager which helps to find the chrome executable.my code snippet below works on my local but on AWS lambda it does not.
import pandas as pdfrom selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECimport timechrome configurationchrome_options = webdriver.ChromeOptions()chrome_options.add_experimental_option("prefs", {> "download.default_directory": '/tmp', # Set a temporary download directory> "download.prompt_for_download": False,> "download.directory_upgrade": True,> "safebrowsing.enabled": True> })use chrome as browserdriver = webdriver.Chrome(options=chrome_options)try:code
After testing the lambda,I receive this error message.
Response { "errorMessage": "Message: Unable to obtain driver for chrome using Selenium Manager.; For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors/driver_location\n", "errorType": "NoSuchDriverException",
Checked the error message website, but as my selenium is v4.13, it is not supposed to happen. any ideas on how to solve this?