All Projects → hardkoded → Puppeteer Sharp

hardkoded / Puppeteer Sharp

Licence: mit
Headless Chrome .NET API

Programming Languages

C#
18002 projects
HTML
75241 projects

Projects that are alternatives of or similar to Puppeteer Sharp

Puppetron
Puppeteer (Headless Chrome Node API)-based rendering solution.
Stars: ✭ 429 (-79.78%)
Mutual labels:  chrome, puppeteer, chromium
Flaresolverr
Proxy server to bypass Cloudflare protection
Stars: ✭ 241 (-88.64%)
Mutual labels:  chrome, puppeteer, chromium
Puppeteer Docs Zh Cn
Google Puppeteer 文档的中文版本 , 目标版本 1.9.0, 翻译中...
Stars: ✭ 61 (-97.13%)
Mutual labels:  chrome, puppeteer, chromium
Headless Chrome Crawler
Distributed crawler powered by Headless Chrome
Stars: ✭ 5,129 (+141.71%)
Mutual labels:  chrome, puppeteer, chromium
Puppeteer Walker
a puppeteer walker 🕷 🕸
Stars: ✭ 78 (-96.32%)
Mutual labels:  chrome, puppeteer
Surfingkeys Conf
A SurfingKeys configuration which adds 130+ key mappings for 20+ sites & OmniBar search suggestions for 50+ sites
Stars: ✭ 137 (-93.54%)
Mutual labels:  chrome, chromium
Chrome Export Passwords
Show all your chromium passwords in format ready to import in other browser like FireFox
Stars: ✭ 80 (-96.23%)
Mutual labels:  chrome, chromium
Chrome Protocol Proxy
Chrome DevTools Protocol Proxy - intelligent proxy for debugging purposes
Stars: ✭ 94 (-95.57%)
Mutual labels:  chrome, chromium
Mue
Fast, open and free-to-use new tab page for modern browsers
Stars: ✭ 56 (-97.36%)
Mutual labels:  chrome, chromium
Pyppeteer
Headless chrome/chromium automation library (unofficial port of puppeteer)
Stars: ✭ 1,286 (-39.4%)
Mutual labels:  puppeteer, chromium
Puppeteer Webperf
Automating Web Performance testing with Puppeteer 🎪
Stars: ✭ 1,392 (-34.4%)
Mutual labels:  chrome, puppeteer
Uget Chrome Wrapper
Moved to https://github.com/ugetdm/uget-integrator and https://github.com/ugetdm/uget-extension
Stars: ✭ 74 (-96.51%)
Mutual labels:  chrome, chromium
Html2image
A package acting as a wrapper around the headless mode of existing web browsers to generate images from URLs and from HTML+CSS strings or files.
Stars: ✭ 69 (-96.75%)
Mutual labels:  chrome, chromium
Chrome Pak Customizer
a simple command-line tool to pack and unpack pak files in chrome or chromium-based browser
Stars: ✭ 79 (-96.28%)
Mutual labels:  chrome, chromium
Wendigo
A proper monster for front-end automated testing
Stars: ✭ 121 (-94.3%)
Mutual labels:  puppeteer, chromium
Roam Research Private Api
Private API to enable API access for Roam Research. Now you can connect Roam to your other projects.
Stars: ✭ 88 (-95.85%)
Mutual labels:  chrome, puppeteer
Sushi Browser
Sushi Browser is the next generation browser which mounts the multi-panel and the video support function and so on. Its goal is to be as fantastic as sushi. 🍣
Stars: ✭ 116 (-94.53%)
Mutual labels:  chrome, puppeteer
Chromecontroller
Comprehensive wrapper and execution manager for the Chrome browser using the Chrome Debugging Protocol.
Stars: ✭ 143 (-93.26%)
Mutual labels:  chrome, chromium
Squidwarc
Squidwarc is a high fidelity, user scriptable, archival crawler that uses Chrome or Chromium with or without a head
Stars: ✭ 125 (-94.11%)
Mutual labels:  chrome, puppeteer
Puppeteer Deep
Puppeteer, Headless Chrome;爬取《es6标准入门》、自动推文到掘金、站点性能分析;高级爬虫、自动化UI测试、性能分析;
Stars: ✭ 1,033 (-51.32%)
Mutual labels:  chrome, puppeteer

Puppeteer Sharp

NuGet Build status Demo build status CodeFactor Backers xs:code

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

Puppeteer-Sharp 3 is here!

Check out the blog post!

Useful links

Prerequisites

How to Contribute and Provide Feedback

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:

Contributing Guide

See this document for information on how to contribute.

Usage

Take screenshots

using 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

Generate PDF files

using 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.PdfAsync(outputFile);

snippet source | anchor

Inject HTML

await using var page = await browser.NewPageAsync();
await page.SetContentAsync("<div>My Receipt</div>");
var result = await page.GetContentAsync();

snippet source | anchor

Evaluate Javascript

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

snippet source | anchor

Wait For Selector

using (var page = await browser.NewPageAsync())
{
    await page.GoToAsync("http://www.spapage.com");
    await page.WaitForSelectorAsync("div.main-content")
    await page.PdfAsync(outputFile));
}

Wait For Function

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;
}

Connect to a remote browser

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");
    }
}

Monthly reports

Backers

Support us with a monthly donation and help us continue our activities. Become a backer.

Thanks

Thanks to JetBrains for a community Resharper license to use on this project.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].