PuppeteerSharp 21.1.1

Puppeteer Sharp

Puppeteer Sharp is a .NET port of the official Node.JS Puppeteer API.

What is Puppeteer Sharp?

Puppeteer Sharp provides a high-level API to control headless Chrome or Chromium over the DevTools Protocol. It can also be configured to use full (non-headless) Chrome or Chromium.

What can you do?

Most things that you can do manually in the browser can be done using Puppeteer Sharp! Here are a few examples:

  • Generate screenshots and PDFs of pages
  • Crawl a SPA (Single-Page Application) and generate pre-rendered content (i.e. "SSR" (Server-Side Rendering))
  • Automate form submission, UI testing, keyboard input, etc.
  • Create an up-to-date, automated testing environment
  • Capture a timeline trace of your site to help diagnose performance issues
  • Test Chrome Extensions

Prerequisites

  • Puppeteer-Sharp comes in two flavors: a NetStandard 2.0 library for .NET Framework 4.6.1 and .NET Core 2.0 or greater and a .NET 8 version.
  • If you have issues running Chrome on Linux, the Puppeteer repo has a great troubleshooting guide.
  • X-server is required on Linux.

Usage

Take screenshots

var browserFetcher = new BrowserFetcher();
await browserFetcher.DownloadAsync();
await using var browser = await Puppeteer.LaunchAsync(
    new LaunchOptions { Headless = true });
await using var page = await browser.NewPageAsync();
await page.GoToAsync("http://www.google.com");
await page.ScreenshotAsync(outputFile);

Generate PDF files

var browserFetcher = new BrowserFetcher();
await browserFetcher.DownloadAsync();
await using var browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true });
await using var page = await browser.NewPageAsync();
await page.GoToAsync("http://www.google.com");
await page.EvaluateExpressionHandleAsync("document.fonts.ready"); // Wait for fonts to be loaded
await page.PdfAsync(outputFile);

Evaluate Javascript

await using var page = await browser.NewPageAsync();
var seven = await page.EvaluateExpressionAsync<int>("4 + 3");
var someObject = await page.EvaluateFunctionAsync<JsonElement>("(value) => ({a: value})", 5);
Console.WriteLine(someObject.GetProperty("a").GetString());

Support

If you have an issue or a question:

Contributing

Check out contributing guide to get an overview of Puppeteer Sharp development.

No packages depend on PuppeteerSharp.

.NET 10.0

.NET Standard 2.0

Version Downloads Last updated
25.1.0 0 06/03/2026
25.0.4 5 05/29/2026
24.42.0 5 05/29/2026
24.40.0 6 05/25/2026
24.39.1 5 05/30/2026
24.39.0 5 05/29/2026
24.38.0 5 05/29/2026
21.1.1 5 05/29/2026
21.1.0 4 05/29/2026
21.0.1 5 05/29/2026
21.0.0 5 05/29/2026
20.2.6 5 05/29/2026
20.2.5 4 05/29/2026
20.2.4 5 05/29/2026
20.2.2 5 05/30/2026
20.2.1 4 05/30/2026
20.2.0 5 05/30/2026
20.1.3 5 05/30/2026
20.1.2 5 05/29/2026
20.1.1 4 05/29/2026
20.1.0 5 05/29/2026
20.0.5 5 05/29/2026
20.0.4 6 05/29/2026
20.0.3 5 05/29/2026
20.0.2 5 05/29/2026
20.0.1-beta1 4 05/29/2026
20.0.0 5 05/28/2026
19.0.2 6 05/29/2026
19.0.1 6 05/29/2026
19.0.0 4 05/29/2026
19.0.0-beta2 5 05/29/2026
19.0.0-beta1 5 05/29/2026
18.1.0 5 05/29/2026
18.1.0-beta1 4 05/29/2026
18.0.5 5 05/29/2026
18.0.4 5 05/29/2026
18.0.3 5 05/29/2026
18.0.2 6 05/29/2026
18.0.1 5 05/29/2026
18.0.0 5 05/29/2026
17.0.0 5 05/29/2026
16.0.0 5 05/29/2026
15.1.0 6 05/29/2026
15.0.0 5 05/29/2026
14.1.0 6 05/29/2026
14.0.0 5 05/29/2026
13.0.2 5 05/29/2026
13.0.1 5 05/29/2026
13.0.0 5 05/30/2026
12.0.0 5 05/30/2026
11.0.6 5 05/29/2026
11.0.5 5 05/29/2026
11.0.4 4 05/29/2026
11.0.3 6 05/29/2026
11.0.2 4 05/29/2026
11.0.1 5 05/29/2026
11.0.0 4 05/29/2026
10.1.4 5 05/29/2026
10.1.2 6 05/30/2026
10.1.1 5 05/29/2026
10.1.0 4 05/29/2026
10.0.0 4 05/30/2026
9.1.0 5 05/29/2026
9.0.2 6 05/29/2026
9.0.1 5 05/29/2026
9.0.0 5 05/30/2026
8.0.0 5 05/30/2026
7.1.0 5 05/29/2026
7.0.0 5 05/29/2026
6.2.0 5 05/30/2026
6.1.0 5 05/29/2026
6.0.0 4 05/29/2026
5.1.0 5 05/29/2026
5.0.0 5 05/29/2026
4.0.0 5 05/29/2026
3.0.0 4 05/29/2026
2.0.4 5 05/29/2026
2.0.3 5 05/29/2026
2.0.2 5 05/29/2026
2.0.1 4 05/29/2026
2.0.0 5 05/29/2026
1.20.0 4 05/29/2026
1.20.0-alpha 5 05/30/2026
1.19.0 6 05/29/2026
1.18.0 3 05/30/2026
1.17.2 5 05/29/2026
1.17.1 5 05/29/2026
1.17.0 5 05/29/2026
1.16.0 5 05/29/2026
1.15.0 5 05/29/2026
1.14.1 5 05/29/2026
1.14.0 5 05/29/2026
1.13.0 4 05/29/2026
1.12.1 6 05/29/2026
1.12.0 4 05/29/2026
1.11.2 5 05/29/2026
1.11.1 5 05/29/2026
1.11.0 5 05/29/2026
1.10.0 4 05/29/2026
1.9.0 6 05/29/2026
1.8.0 5 05/29/2026
1.7.0 4 05/30/2026
1.6.2 5 05/29/2026
1.6.0 6 05/29/2026
1.5.0 5 05/29/2026
1.4.0 5 05/29/2026
1.3.0 5 05/30/2026
1.2.0 5 05/29/2026
1.1.0 5 05/29/2026
1.0.2 5 05/29/2026
1.0.1 4 05/30/2026
1.0.0 6 05/29/2026
0.8.0 5 05/29/2026
0.7.0 6 05/29/2026
0.6.0 5 05/29/2026
0.5.0 5 05/29/2026
0.4.0 5 05/29/2026
0.3.3 5 05/29/2026
0.3.2 5 05/29/2026
0.3.1 5 05/29/2026
0.3.0 5 05/29/2026
0.1.1 5 05/29/2026
0.1.0 5 05/29/2026
0.0.1 4 05/29/2026