GithubHelp home page GithubHelp logo

nailtongomes / firefox-selenium-docker-lambda Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 4.0 90 KB

Serverless Selenium automation with Firefox on AWS Lambda. Ideal for web scraping, automated testing, and browser automation tasks. Supports multiple use-cases and easy to deploy.

License: MIT License

Dockerfile 17.31% Shell 4.61% Python 78.08%
automation aws-lambda docker firefox python qa-automation-test selenium

firefox-selenium-docker-lambda's Introduction

Firefox Selenium Lambda Docker Image

Table of Contents

  1. Overview
  2. Maintainer
  3. Use Cases
  4. Prerequisites
  5. Build and Run
  6. Environment Variables
  7. Dependencies
  8. Files
  9. Entrypoint
  10. Support

Overview

This Docker image is designed to run Selenium with Firefox on AWS Lambda. It is built on top of the AWS Lambda Python runtime and includes all necessary dependencies for running Selenium and Firefox. This image is suitable for both technical and non-technical users who wish to automate web browser tasks in a serverless environment.

Maintainer

Use Cases

  • Web Scraping: Automatically collect data from websites.
  • Automated Testing: Run your Selenium-based test suites without needing a dedicated server.
  • Data Entry Automation: Automate repetitive data entry tasks.
  • Browser Automation: Perform any task you would manually do in a web browser, but automated.

Prerequisites

  • Docker installed on your machine. If you don't have it, download Docker here.
  • Basic understanding of command-line operations.

Build and Run

Build

1. Build the Docker Image

docker build --platform linux/amd64 -t selenium-lambda .

2. Run the Docker Container

docker run -it --rm -e AWS_LAMBDA_FUNCTION_TIMEOUT=300 -e AWS_LAMBDA_FUNCTION_MEMORY_SIZE=1024 -p 9000:8080 selenium-lambda:latest

3. Local Testing with

Invoke-WebRequest -Uri "http://localhost:9000/2015-03-31/functions/function/invocations" -Method POST -Body '{"headless_mode": false, "needs_download_file": false, "clean_init": false, "script_name": null}'

OR

curl -X POST "http://localhost:9000/2015-03-31/functions/function/invocations" -d "{\"headless_mode\": false, \"needs_download_file\": false, \"clean_init\": false, \"script_name\": null}"

Environment Variables

Variable || Description || Default Value

AWS_LAMBDA_FUNCTION_TIMEOUT || AWS Lambda function timeout || 300 (5 minutes)

AWS_LAMBDA_FUNCTION_MEMORY_SIZE || AWS Lambda function memory size || 1024 MB

SCREEN_WIDTH || Screen width for Selenium || 1920

SCREEN_HEIGHT || Screen height for Selenium || 1080

Dependencies

System Packages

  • Various Linux packages required for running Firefox and Selenium.

Python Packages

  • Libraries for AWS, OpenAI, Excel manipulation, web requests, and more.

Files

  • main.py: The main Python script that AWS Lambda will execute.
  • entrypoint.sh: A shell script that sets up the environment before running main.py.

Entrypoint

The entry point for AWS Lambda is defined as main.handler.

Support Me

For any issues or questions, please contact the maintainer via email.

If you find this project helpful and would like to support its development, consider buying me a coffee or a toy for my children! You can send cryptocurrency to my Coinbase wallet using the following details:

  • Bitcoin (BTC) - Bitcoin Network: 3KEyAyYAyBfXkciRhrejz6ZmXjigZ5GnLj
  • Ethereum (ETH) - Ethereum Network: 0x842c95127163a3bc05a43215f0D85Fb4361Fd460
  • USD Coin (USDC) - Polygon Network: 0xbFf4f280d008Be5D06Ec83B39A3E390e75FcEf94
  • Brazilian Pix: [email protected]

To send cryptocurrency:

  1. Open Your Crypto Wallet: This could be on an exchange like Binance, Coinbase, or a personal wallet.
  2. Go to the Send Section: Usually denoted by a "Send" button.
  3. Enter the Wallet Address: Copy and paste the appropriate wallet address from above.
  4. Confirm the Transaction: Make sure to double-check the address and amount before sending.

Your support is greatly appreciated!

firefox-selenium-docker-lambda's People

Contributors

nailtongomes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

firefox-selenium-docker-lambda's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.