I created selenium and I want to deploy my script on the function I want to know if I could run selenium in the function if yes please let me know how I can do it. please feel; free to share with me another way I can deploy the Selenium code thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi there,
I believe that running Selenium in serverless environments can be a complex task due to the need for a browser or browser-like environment.
I think that using a Droplet might be a more suitable solution for this use-case as you will have full access to the server and you will be able to install and configure the server to exactly meet your requirements.
Here is a quick tutorial on how to do that:
1. Set Up a New Droplet
If you haven’t already, create a new Ubuntu Droplet on DigitalOcean:
2. Connect to the Droplet
SSH into your Droplet using the command:
3. Install Google Chrome (or Another Web Browser)
You’ll need a web browser to run Selenium. Here’s how you can install Google Chrome:
4. Install ChromeDriver
You’ll also need ChromeDriver, which allows Selenium to interface with the Chrome browser:
Make sure to download a version of ChromeDriver that is compatible with the installed version of Google Chrome.
5. Install Python (or Another Language) and Selenium
Install Python, pip, and Selenium:
6. Write Your Selenium Script
You can now write your Selenium script using the headless option:
7. Run Your Script
You can now run your Selenium script with the following:
For more information, I could also suggest these tutorials here as well:
Best,
Bobby