Packages everything you need to run PuppeteerSharp in AWS Lambda on Chromium into a Nuget Package
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
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
These projects are using this library and are good examples of how you might consume this nuget package
To build locally:
.\build.ps1 -Target Build