CDP 0.2.5

.NET bindings for the Chrome DevTools Protocol

Install-Package CDP -Version 0.2.5
dotnet add package CDP --version 0.2.5
<PackageReference Include="CDP" Version="0.2.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CDP --version 0.2.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Usage

using System;
using System.IO;
using CDP;
using CDP.Protocols;

class MainClass {
    public static void Main(string[] args) {
        HeadlessChrome chrome = new HeadlessChrome(
            HeadlessChrome.DefaultAppPathMac
        );
        // "using" clause ensures that close the chrome process
        using (chrome) {
            chrome.Page.FrameNavigated += (sender, e) => {
                Console.WriteLine("FrameNavigated: " + e.Frame.Id);
            };
            chrome.Start();
            chrome.Page.Enable();
            chrome.Page.Navigate("http://google.com");
            var png = chrome.Page.CaptureScreenshot();
            File.WriteAllBytes("Screenshot.png", png.Data);
            chrome.Delay(1000);
        }
    }
}

Please see the Wiki for more detailed usage

Usage

using System;
using System.IO;
using CDP;
using CDP.Protocols;

class MainClass {
    public static void Main(string[] args) {
        HeadlessChrome chrome = new HeadlessChrome(
            HeadlessChrome.DefaultAppPathMac
        );
        // "using" clause ensures that close the chrome process
        using (chrome) {
            chrome.Page.FrameNavigated += (sender, e) => {
                Console.WriteLine("FrameNavigated: " + e.Frame.Id);
            };
            chrome.Start();
            chrome.Page.Enable();
            chrome.Page.Navigate("http://google.com");
            var png = chrome.Page.CaptureScreenshot();
            File.WriteAllBytes("Screenshot.png", png.Data);
            chrome.Delay(1000);
        }
    }
}

Please see the Wiki for more detailed usage

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.2.5 53 2/5/2020
0.2.4 56 2/4/2020
0.2.3 55 2/3/2020
0.2.2 40 1/30/2020
0.2.1 151 1/29/2020
0.2.0 83 1/28/2020
0.1.1 124 1/26/2020
0.1.0 126 1/26/2020