Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 1.77 KB

File metadata and controls

35 lines (27 loc) · 1.77 KB

HeadlessChromium.Puppeteer.Lambda.Dotnet

Packages everything you need to run PuppeteerSharp in AWS Lambda on Chromium into a Nuget Package

Build status CodeFactor Nuget status

Description

The chromium binary for this project has been extracted from the NPM project Sparticuz/chromium. It is automatically extracted to /tmp/chromium at runtime. This project requires the lambda runtime to be configured as dotnet6 or dotnet8. For now, the chromium binary only supports x86_64

Usage

Screenshot a URL as a byte[].

var browserLauncher = new HeadlessChromiumPuppeteerLauncher(logger);

using(var browser = await browserLauncher.LaunchAsync())
using(var page = await browser.NewPageAsync())
{
    await page.GoToAsync(url);
    return await page.ScreenshotDataAsync();
}

For more use cases see the PuppeteerSharp documentation

Projects using this library

These projects are using this library and are good examples of how you might consume this nuget package

Building

To build locally:

.\build.ps1 -Target Build