PuppeteerSharp 20.2.6

dotnet add package PuppeteerSharp --version 20.2.6
                    
NuGet\Install-Package PuppeteerSharp -Version 20.2.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PuppeteerSharp" Version="20.2.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PuppeteerSharp" Version="20.2.6" />
                    
Directory.Packages.props
<PackageReference Include="PuppeteerSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add PuppeteerSharp --version 20.2.6
                    
#r "nuget: PuppeteerSharp, 20.2.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package PuppeteerSharp@20.2.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=PuppeteerSharp&version=20.2.6
                    
Install as a Cake Addin
#tool nuget:?package=PuppeteerSharp&version=20.2.6
                    
Install as a Cake Tool

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.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.
PhantomGamers/SFP
This utility is designed to allow you to apply skins to the modern Steam client
CodeCubist/FufuLauncher
A third-party launcher for Genshin Impact that supports game injection, automatic check-in, and some useful small features.
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
20.2.6 7,825 1/31/2026
20.2.5 246,805 12/9/2025
20.2.4 574,136 10/7/2025
20.2.2 1,000,482 7/17/2025
20.2.1 127,450 7/15/2025
20.2.0 195,578 7/1/2025
20.1.3 1,335,211 2/26/2025
20.1.2 103,544 2/19/2025
20.1.1 71,372 2/15/2025
20.1.0 177,276 2/4/2025
20.0.5 1,450,119 11/7/2024
20.0.4 107,394 10/31/2024
20.0.3 110,377 10/22/2024
20.0.2 525,847 9/20/2024
20.0.1-beta1 14,198 9/4/2024
20.0.0 246,035 9/4/2024
19.0.2 155,628 8/29/2024
19.0.1 218,492 8/20/2024
19.0.0 25,383 8/20/2024
19.0.0-beta2 3,067 8/7/2024
19.0.0-beta1 334 8/1/2024
18.1.0 368,035 8/8/2024
18.1.0-beta1 221 8/5/2024
18.0.5 211,685 7/22/2024
18.0.4 109,131 7/15/2024
18.0.3 445,347 7/3/2024
18.0.2 100,650 6/24/2024
18.0.1 130,981 6/6/2024
18.0.0 564,621 5/20/2024
17.0.0 318,728 4/23/2024
16.0.0 220,150 4/3/2024
15.1.0 235,359 3/20/2024
15.0.0 103,082 3/13/2024
14.1.0 510,996 2/15/2024
14.0.0 235,984 1/25/2024
13.0.2 642,032 12/5/2023
13.0.1 316,454 11/22/2023
13.0.0 10,548 11/22/2023
12.0.0 844,047 9/25/2023
11.0.6 187,721 9/15/2023
11.0.5 92,468 9/4/2023
11.0.4 22,049 8/31/2023
11.0.3 7,420 8/30/2023
11.0.2 52,302 8/23/2023
11.0.1 4,035 8/23/2023
11.0.0 42,628 8/16/2023
10.1.4 235,683 8/15/2023
10.1.2 485,574 7/17/2023
10.1.1 86,098 7/12/2023
10.1.0 324,291 6/20/2023
10.0.0 346,311 5/5/2023
9.1.0 272,110 4/9/2023
9.0.2 979,774 1/26/2023
9.0.1 50,007 1/18/2023
9.0.0 137,645 1/13/2023
8.0.0 922,539 10/6/2022
7.1.0 703,031 7/11/2022
7.0.0 705,074 4/13/2022
6.2.0 809,826 2/15/2022
6.1.0 568,849 12/22/2021
6.0.0 501,030 11/19/2021
5.1.0 477,709 9/27/2021
5.0.0 482,819 7/11/2021
4.0.0 720,164 4/17/2021
3.0.0 171,429 3/22/2021
2.0.4 1,873,314 7/30/2020
2.0.3 512,354 4/16/2020
2.0.2 483,084 3/2/2020
2.0.1 65,783 2/19/2020
2.0.0 536,341 11/6/2019
1.20.0 150,741 9/22/2019
1.20.0-alpha 1,423 10/15/2019
1.19.0 713,443 8/12/2019
1.18.0 54,570 7/15/2019
1.17.2 99,130 6/17/2019
1.17.1 119,393 5/27/2019
1.17.0 4,642 5/27/2019
1.16.0 4,435 5/23/2019
1.15.0 30,087 5/15/2019
1.14.1 38,030 5/6/2019
1.14.0 34,603 4/9/2019
1.13.0 80,600 3/28/2019
1.12.1 57,013 3/7/2019
1.12.0 27,044 3/4/2019
1.11.2 60,649 1/26/2019
1.11.1 353,080 12/18/2018
1.11.0 41,577 12/17/2018
1.10.0 178,629 11/25/2018
1.9.0 56,201 10/28/2018
1.8.0 68,792 10/4/2018
1.7.0 12,318 9/24/2018
1.6.2 4,200 9/15/2018
1.6.0 4,782 9/14/2018
1.5.0 19,742 9/1/2018
1.4.0 13,344 7/27/2018
1.3.0 5,390 7/23/2018
1.2.0 4,863 7/13/2018
1.1.0 5,853 6/28/2018
1.0.2 6,696 6/23/2018
1.0.1 6,063 6/5/2018
1.0.0 5,006 6/4/2018
0.8.0 12,558 5/11/2018
0.7.0 6,488 5/8/2018
0.6.0 4,324 5/4/2018
0.5.0 4,260 4/30/2018
0.4.0 4,875 4/21/2018
0.3.3 4,330 4/12/2018
0.3.2 4,254 3/27/2018
0.3.1 4,323 3/17/2018
0.3.0 4,381 3/14/2018
0.1.1 4,356 2/28/2018
0.1.0 4,303 2/27/2018
0.0.1 12,525 10/2/2017