PuppeteerSharp 21.0.1
dotnet add package PuppeteerSharp --version 21.0.1
NuGet\Install-Package PuppeteerSharp -Version 21.0.1
<PackageReference Include="PuppeteerSharp" Version="21.0.1" />
<PackageVersion Include="PuppeteerSharp" Version="21.0.1" />
<PackageReference Include="PuppeteerSharp" />
paket add PuppeteerSharp --version 21.0.1
#r "nuget: PuppeteerSharp, 21.0.1"
#:package PuppeteerSharp@21.0.1
#addin nuget:?package=PuppeteerSharp&version=21.0.1
#tool nuget:?package=PuppeteerSharp&version=21.0.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());
Useful links
Support
If you have an issue or a question:
- Ask a question on Stack Overflow
- File a new issue
Contributing
Check out contributing guide to get an overview of Puppeteer Sharp development.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.0)
- Microsoft.Extensions.Logging (>= 8.0.0)
- System.Text.Json (>= 10.0.0)
- WebDriverBiDi-Relaxed (>= 0.0.41)
-
net8.0
- Microsoft.Extensions.Logging (>= 8.0.0)
- WebDriverBiDi-Relaxed (>= 0.0.41)
NuGet packages (154)
Showing the top 5 NuGet packages that depend on PuppeteerSharp:
| Package | Downloads |
|---|---|
|
HeadlessChromium.Puppeteer.Lambda.Dotnet
Package Description |
|
|
Plotly.NET.ImageExport
An easily extensible library to render static images from Plotly.NET charts. |
|
|
PuppeteerExtraSharp
Package Description |
|
|
SautinSoft.PdfVision
Designed to help you to convert any complex HTML pages saturated by CSS and Javascript to PDF documents. - Convert HTML to PDF - Get screenshot from HTML - Convert multipage-TIFF to PDF - Generate PDF from JPEG, PNG, GIF, Bitmap, TIFF - Create PDF from pack of images at once, like a Photo Gallery - Compatible on multiple platforms, such as Windows, macOS, and Linux - Deploy to Azure and AWS Requires only .NET Framework 4.6.2 or higher. Can be used in .NET 6.0 and higher. Absolutely standalone library. |
|
|
dotnetreport
Dotnet Report is a powerful .NET Embedded Analytics and Reporting Solution that simplifies adding customizable, user-friendly report-building and data visualization features to your ASP.NET Web Applications. Designed for developers, it offers seamless integration, intuitive interfaces, and robust reporting capabilities to empower end-users with actionable insights. Perfect for businesses looking to enhance data-driven decision-making and streamline reporting workflows. |
GitHub repositories (32)
Showing the top 20 popular GitHub repositories that depend on PuppeteerSharp:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
DearVa/Everywhere
Context-aware AI assistant for your desktop. Ready to respond intelligently, seamlessly integrating multiple LLMs and MCP tools.
|
|
|
phongnguyend/Practical.CleanArchitecture
Full-stack .Net 10 Clean Architecture (Microservices, Modular Monolith, Monolith), Blazor, Angular 21, React 19, Vue 3.5, BFF with YARP, NextJs 16, Domain-Driven Design, CQRS, SOLID, Asp.Net Core Identity Custom Storage, OpenID Connect, EF Core, OpenTelemetry, SignalR, Background Services, Health Checks, Rate Limiting, Clouds (Azure, AWS, GCP), ...
|
|
|
openbullet/OpenBullet2
OpenBullet reinvented
|
|
|
ariacom/Seal-Report
Database Reporting Tool and Tasks (.Net)
|
|
|
KoalaBear84/OpenDirectoryDownloader
Indexes open directories
|
|
|
simpleidserver/SimpleIdServer
OpenID, OAuth 2.0, SCIM2.0, UMA2.0, FAPI, CIBA & OPENBANKING Framework for ASP.NET Core
|
|
|
ic3w0lf22/Roblox-Account-Manager
Application that allows you to add multiple accounts into one application allowing you to easily play on alt accounts without having to change accounts
|
|
|
trueai-org/midjourney-proxy
🦄 The world's largest Midjourney drawing API, generating over 1 million drawings daily, supporting Discord Youchuan Midjourney 🐂!
|
|
|
amakvana/SwitchEmuModDownloader
SwitchEmuModDownloader - A Cross-Platform One-Click Games Mod Downloader for Switch emulators. Formerly YuzuModDownloader.
|
|
|
Element-Blazor/Element-Blazor
A Web UI Library based on Element and Blazor WebAssembly.
|
|
|
SparkDevNetwork/Rock
An open source CMS, Relationship Management System (RMS) and Church Management System (ChMS) all rolled into one.
|
|
|
CodeCubist/FufuLauncher
A third-party launcher for Genshin Impact that supports game injection, automatic check-in, and some useful small features.
|
|
|
PhantomGamers/SFP
This utility is designed to allow you to apply skins to the modern Steam client
|
|
|
IvanJosipovic/BlazorTable
Blazor Table Component with Sorting, Paging and Filtering
|
|
|
fmbot-discord/fmbot
.fmbot is a social Discord bot that provides music statistics for you and your friends.
|
|
|
axzxs2001/Asp.NetCoreExperiment
原来所有项目都移动到**OleVersion**目录下进行保留。新的案例装以.net 5.0为主,一部分对以前案例进行升级,一部分将以前的工作经验总结出来,以供大家参考!
|
|
|
C9Glax/tranga
Monitor and download Manga automatically in a Docker-Container.
|
|
|
zhupingqi/RuiJi.Net
crawler framework, distributed crawler extractor
|
|
|
drizzle-mizzle/CharacterAI-Discord-Bot
CharacterAI for your Discord server
|
| Version | Downloads | Last Updated |
|---|---|---|
| 21.0.1 | 0 | 2/12/2026 |
| 21.0.0 | 345 | 2/11/2026 |
| 20.2.6 | 26,344 | 1/31/2026 |
| 20.2.5 | 290,320 | 12/9/2025 |
| 20.2.4 | 609,492 | 10/7/2025 |
| 20.2.2 | 1,027,647 | 7/17/2025 |
| 20.2.1 | 129,633 | 7/15/2025 |
| 20.2.0 | 199,886 | 7/1/2025 |
| 20.1.3 | 1,357,699 | 2/26/2025 |
| 20.1.2 | 105,133 | 2/19/2025 |
| 20.1.1 | 74,116 | 2/15/2025 |
| 20.1.0 | 179,956 | 2/4/2025 |
| 20.0.5 | 1,465,417 | 11/7/2024 |
| 20.0.4 | 108,966 | 10/31/2024 |
| 20.0.3 | 111,678 | 10/22/2024 |
| 20.0.2 | 529,616 | 9/20/2024 |
| 20.0.1-beta1 | 14,331 | 9/4/2024 |
| 20.0.0 | 249,592 | 9/4/2024 |
| 19.0.2 | 157,959 | 8/29/2024 |
| 19.0.1 | 220,764 | 8/20/2024 |