Add parameter for which website to load?
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())
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!
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
As far as I'm concerned, it can be closed now😅