Skip to content

Capture screenshot of webpage in full or a specific node and return them as JPEG, PNG or even PDFs.

License

Notifications You must be signed in to change notification settings

qrstuff/screenshuttle

Repository files navigation

screenshuttle

This project provides a service to capture screenshots or PDFs of web pages using AWS Lambda and Puppeteer. The service can be configured to capture specific elements, hide certain elements, and set custom dimensions and formats for the output.

Usage

Clone the project and install dependencies (only required for code-completion) using Yarn:

yarn install

Build and run the Docker image:

# build Docker image
docker build -t screenshuttle .

# start a test container
docker run -it --rm -p 8080:8080 screenshuttle

Test Lambda execution by sending a test event:

curl -X POST "http://127.0.0.1:8080/2015-03-31/functions/function/invocations" -H "content-type: application/json" -d '{"url": "http://example.com/"}'

There are more options supported by handler than you can pass as event data e.g., as below:

{
    "url": "http://example.com/",
    "exclude": ["#hide-me", ".hide-me-too"],
    "format": "jpeg", # one of jpeg, pdf or png
    "fullpage": true,
    "selector": "#only-me",
    "width": 1280,
    "heigt": 720
}

License

See the LICENSE file for details. Made with ❤️ at QRStuff.

About

Capture screenshot of webpage in full or a specific node and return them as JPEG, PNG or even PDFs.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •