docker-selenium-lambda icon indicating copy to clipboard operation
docker-selenium-lambda copied to clipboard

Add parameter for which website to load?

Open filipopo opened this issue 4 months ago • 3 comments

Have you thought about putting something like this, which would make this functional out of the box?

chrome.get(event.get("target", "https://example.com/"))

Maybe even something like this to use this setup outside of Lambda

if os.getenv('AWS_LAMBDA_FUNCTION_NAME') is None:
    print(handler())

filipopo avatar Aug 09 '25 18:08 filipopo

Hi @filipopo,

Thanks for the suggestion! Those are definitely useful enhancements.

I'd prefer to keep the main code minimal for first-time users, but we could add an "Advanced Usage" section to the README showing like this?:

# Dynamic URL
chrome.get(event.get("url", "https://example.com/"))
# Usage: sls invoke --function demo --data '{"url": "https://github.com"}'

# Local execution
if __name__ == "__main__" and os.getenv('AWS_LAMBDA_FUNCTION_NAME') is None:
    print(handler())

Would you be interested in contributing a documentation PR for this? Thanks!

umihico avatar Aug 09 '25 23:08 umihico

Done #338

The truth of the matter is that I wanted to see your opinion on how minimal/advanced an example should be, so I can see what to do with my repo XD https://github.com/filipopo/undetected-chromedriver-lambda

filipopo avatar Aug 10 '25 09:08 filipopo

As far as I'm concerned, it can be closed now😅

filipopo avatar Sep 05 '25 13:09 filipopo