Can I use Selenium WebDriver with Google Cloud Functions?
Solution 1:
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.
- Python Headless Browser for GAE
- Python headless Chrome with Cloud Run
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.