'Can I use Selenium WebDriver with Google Cloud Functions?

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..:

How or where can I check if this is still the case?



Solution 1:[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.

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.

Solution 2:[2]

TLDR: No you can't open any sort of webpage (that is not just an API call) with firebase functions.

You can use Google Cloud Run to have selenium / cypress / spyder run. GCR achieves a similaresq result, that being it is serverless and scalable.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Priyashree Bhadra
Solution 2 Péter Szabó-tóth