SeleniumBase specify path to chromedriver #3087
-
I have my lambda code deployed on ECR and I have a script that downloads the crome driver for linux. I know that seleniumbase initiation downloads the chrome automatically but the problem is it uses downloaded_files folder and my lambda can't write it since it has limitations. I tried making /tmp folder where lambda seems to have writing permission but it doesn't work. Can I manually specify the path where my chromedriver gets downloaded and use it like its being used in selenium? Something like this:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
There are 2 places SeleniumBase checks for drivers:
If you don't want to use the |
Beta Was this translation helpful? Give feedback.
-
Ok So I managed to get the files up and running but there is an issue. Since Lambda runtime environment allows the writing only on /tmp folder I am getting issue of : OSError: [Errno 30] Read-only file system: '/var/lang/lib/python3.12/site-packages/seleniumbase/drivers/uc_driver' My question is I guess, can I use seleniumbase on lambda AWS given its runtime environment restricitons? |
Beta Was this translation helpful? Give feedback.
There are 2 places SeleniumBase checks for drivers:
seleniumbase/drivers
folder.os.environ["PATH"]
, in order.If you don't want to use the
seleniumbase/drivers
folder fordriver
storage, then you can downloadchromedriver
manually to a folder on your System PATH. The version ofchromedriver
must match your version of Chrome, or else SeleniumBase will automatically download a matching driver to theseleniumbase/drivers
folder, which can't be changed. You can, however, changeos.environ["PATH"]
at runtime so that you can add a folder to the front that isn't already there.