• Stars
    star
    181
  • Rank 212,110 (Top 5 %)
  • Language
    C#
  • License
    MIT License
  • Created about 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Plugin framework for PuppeteerSharp

PuppeteerExtraSharp

NuGet Badge

Puppeteer extra sharp is a .NET port of the Node.js library

Quickstart

// Initialization plugin builder
var extra = new PuppeteerExtra(); 

// Use stealth plugin
extra.Use(new StealthPlugin());   

// Launch the puppeteer browser with plugins
var browser = await extra.LaunchAsync(new LaunchOptions()
{
    Headless = false
});

// Create a new page
var page = await browser.NewPageAsync();

await page.GoToAsync("http://google.com");

// Wait 2 second
await page.WaitForTimeoutAsync(2000);

// Take the screenshot
await page.ScreenshotAsync("extra.png");

Plugin list

🏴 Puppeteer stealth plugin

  • Applies various evasion techniques to make detection of headless puppeteer harder.

πŸ“ƒ Puppeteer anonymize UA plugin

  • Anonymizes the user-agent on all pages.

πŸ’€Puppeteer recaptcha plugin

  • Solves recaptcha automatically

πŸ”§Puppeteer block resources plugin

  • Blocks images, documents etc.

βœ‹More plugins coming soon

API

Use(IPuppeteerExtraPlugin)

Adds a new plugin to plugins list and register it.

  • Returns the same instance of puppeteer extra
  • Parameters: instance of IPuppeteerExtraPlugin interface
var puppeteerExtra = new PuppeteerExtra().Use(new AnonymizeUaPlugin()).Use(new StealthPlugin());

LaunchAsync(LaunchOptions)

  • Return the new puppeteer browser instance with launch options
var browser = new PuppeteerExtra().LaunchAsync(new LaunchOptions());

ConnectAsync(ConnectOptions)

  • Connect to the exiting browser with connect options
var browser = new PuppeteerExtra().ConnectAsync(new ConnectOptions());

GetPlugin()

  • Get plugin from plugin list by type
var stealthPlugin = puppeteerExtra.GetPlugin<StealthPlugin>();