Puppeteer on Lambda! Updated and better.

Demo code here

Uploading directly to Lambda has a size limit of 50MB.

This makes it difficult for Puppeteer, which is a very large library. Uploading your code to s3 and then updating your function from there increases this size limit to (I think) 250MB!

I use 7zip and typescript and here is my scripts that I use to upload to Lambda.

"scripts": {
    "zip": "tsc && 7z a -r function.zip ./dist/*  node_modules/",
    "sendToLambda": "npm run zip && aws s3 cp function.zip s3://chrome-aws && aws lambda update-function-code --function-name puppeteer-on-lambda --s3-bucket chrome-aws --s3-key function.zip"
  },

Looking for business leads?

Using the techniques talked about here at javascriptwebscrapingguy.com, we’ve been able to launch a way to access awesome web data. Learn more at Cobalt Intelligence!

Leave a Reply

Hey there. Want to be friends?

I'll be straight with you. I'm going to want to show off my web scraping genius. But I want to hear about your web scraping troubles and successes as well.

And I like you. So I won't be one of those weird friends who is always calling. What do you say?