AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
헤드리스 Chrome을 위한 .NET API
Headless Chrome .NET API
개발 도구C# · HTMLGitHub @hardkoded직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Puppeteer Sharp is a .NET port of the official Node.JS Puppeteer API.
Test the latest Firefox versions using WebDriver BiDi! Check the PuppeteerSharp 21 release notes.
PuppeteerSharp now supports AOT compilation! Check the PuppeteerSharp 19 release notes!.
| Package | Description |
|---|---|
| PuppeteerSharp | Our full cross-browser automation tool |
| PuppeteerSharp.Cdp | Ideal for Chrome-only AOT apps where binary size matters |
| PuppeteerSharp.AspNetFramework | The companion library you need to run PuppeteerSharp in ASP.NET Classic |
Some of the best ways to contribute are to try things out file bugs and fix issues.
If you have an issue or a question:
See this document for information on how to contribute.
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);
snippet source | anchor
You can also change the view port before generating the screenshot
await Page.SetViewportAsync(new ViewPortOptions
{
Width = 500,
Height = 500
});
snippet source | anchor
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"); // In case of fonts being loaded from a CDN, use WaitUntilNavigation.Networkidle0 as a second param.
await page.EvaluateExpressionHandleAsync("document.fonts.ready"); // Wait for fonts to be loaded. Omitting this might result in no text rendered in pdf.
await page.PdfAsync(outputFile);
snippet source | anchor
await using var page = await browser.NewPageAsync();
await page.SetContentAsync("<div>My Receipt</div>");
var result = await page.GetContentAsync();
snippet source | anchor
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());
snippet source | anchor
using (var page = await browser.NewPageAsync())
{
await page.GoToAsync("http://www.spapage.com");
await page.WaitForSelectorAsync("div.main-content")
await page.PdfAsync(outputFile));
}
using (var page = await browser.NewPageAsync())
{
await page.GoToAsync("http://www.spapage.com");
var watchDog = page.WaitForFunctionAsync("()=> window.innerWidth < 100");
await page.SetViewportAsync(new ViewPortOptions { Width = 50, Height = 50 });
await watchDog;
}
var options = new ConnectOptions()
{
BrowserWSEndpoint = $"wss://www.externalbrowser.io?token={apikey}"
};
var url = "https://www.google.com/";
using (var browser = await PuppeteerSharp.Puppeteer.ConnectAsync(options))
{
using (var page = await browser.NewPageAsync())
{
await page.GoToAsync(url);
await page.PdfAsync("wot.pdf");
}
}
PuppeteerSharp is sponsored by IronPDF, a commercial C# .NET PDF library and HTML-to-PDF alternative with Chrome rendering, PDF editing, digital signatures, encryption, enterprise licensing, and 24/7 engineering support.
A massive thanks to JetBrains for a community Resharper and Rider license to use on this project.
And a huge thanks to everyone who sponsors this project through Github sponsors: