DEV Community

Jordan Hansen
Jordan Hansen

Posted on • Originally published at javascriptwebscrapingguy.com on

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"
  },
Enter fullscreen mode Exit fullscreen mode

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!

The post Puppeteer on Lambda! Updated and better. appeared first on Javascript Web Scraping Guy.

Top comments (1)

Collapse
 
codingtomusic profile image
Tom Connors

This is just spam

This is useless content that makes the site useless