Hey everyone! I'm curious if I can utilize AWS Lambda to execute scripts that automate tasks in browsers like Chrome or Firefox, particularly without a graphical interface or in headless mode. Also, is it possible for these scripts to use resources from my PC, such as memory?
4 Answers
For your need, take a look at Amazon CloudWatch Synthetics. It provides synthetic monitoring with canaries. This could be helpful for your automation tasks. Here’s the link: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Synthetics_Canaries.html
Just to clarify, Lambda doesn't actually consume resources from your PC since it's a serverless solution running on AWS servers. If you want to run something locally, you'd be better off coding a script or using containers. There are ways to run these functions locally, but Lambda's primary advantage is that it handles everything on its own.
You can run scripts in AWS Lambda using headless Chrome, mainly for purposes like automated testing. However, beware of the execution time limits; browsers can be quite resource-heavy, so make sure you're prepared for those costs. A good approach is to create a Docker image for use with Lambda.
I agree with some of the others here. It might be more beneficial for you to elaborate on your goals rather than asking specific questions like this, as it could lead to mixed advice. Consider showing what you're trying to achieve.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically