I am trying to build a solution with Selenium, can I use Firebase Functions to initialize and load webpages with Selenium?
I have found some resources that state no; however they don't give any source and they are 4 years old..:
- Using Selenium from within Cloud Functions for Firebase
- Google Firebase Functions: webdriver.io get source code of a html-website
How or where can I check if this is still the case?
CodePudding user response:
You can't currently use Python to run Selenium scripts in Google Cloud Functions. There's a Feature Request in the Public Issue Tracker currently open, that can be found here. For the Node.js runtime for your Cloud Functions, you could use puppeteer which includes headless Chrome. I found this blog post that details a use-case.
Or if you are ready to trade Python for Cloud functions, we have other services like : App Engine Flex and Cloud Run where you can get it working in Python.
I also found this GitHub link which vouches to run selenium on Google Cloud Functions. If you're fine with a JavaScript/TypeScript example instead of Python, I recommend that you try this template. However, I have not tested this.
