0

I am trying to run Python Selenium with lambda layers.

I have followed this GitHub page: https://github.com/alvaroseparovich/AWS-LAMBDA-LAYER-Selenium

First, I have uploaded the zip as lambda layer and then created a function as:

import starter as st

def lambda_handler(event, context):
    driver = st.start_drive()
    driver.get('https://www.google.com.br')
    page_data = driver.page_source
    driver.close()
    return page_data

but, it's returning the error as:

Unable to import module 'lambda_function': No module named 'starter'

How can I determine the cause of it?

1

1 Answer 1

0

you can package your program with all the dependencies and make a zip file and upload it to lamda.

Try below, https://docs.aws.amazon.com/lambda/latest/dg/python-package.html

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.