I am creating an AWS lambda function which when invoked , finds the last message in Gmail messages (using GmailAPI) downloads the attachments into aws /tmp folder , goes to certain website using selenium chromedriver , uploads those attachments , downloads a file and sends it back to sender using GmailAPI again. everything worked well on my local pycharm env , but fitting my function to AWS lambda arose some problems. My main problem now is that selenium , as I know , saves cache locally , which is impossible in this scenario , because I imported selenium as a layer , and it’s a read-only package , so data cant be stored. I save the attachments and downloaded files in tmp folder but I don’t know how to change the selenium cache folder to /tmp folder. How do I change the webdriver cache folder to aws tmp folder?Is it the only selenium directory that is overwritten/changed ? if not , what are other directories that are changed while using the webdriver and is there any way to use /tmp for them too?
I spent hours browsing stackoverflow , but almost all of the article problems were different from mine. I tried uploading the chromedriver.exe file to /tmp folder thinking it could create cache folder there , there came the “format error” / “”Message: ‘chromedriver’ executable may have wrong permissions.”. then I tried finding solutions for these errors , but none of them actually worked. I have to say that I’m not running chrome in headless mode. I’m also thinking about using docker image , but I have 0 experience with it and I don’t know if it will even fix my problem.
pdf maker is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.