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 chrome-aws-lambda. It is automatically extracted to /tmp/chromium
at runtime.
Screenshot a URL as a byte[]. This project requires lambda to be configured as netcoreapp3.1
var browserLauncher = new HeadlessChromiumPuppeterLauncher(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