Netlenium 1.0.1

dotnet add package Netlenium --version 1.0.1
                    
NuGet\Install-Package Netlenium -Version 1.0.1
                    
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="Netlenium" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Netlenium" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Netlenium" />
                    
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 Netlenium --version 1.0.1
                    
#r "nuget: Netlenium, 1.0.1"
                    
#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 Netlenium@1.0.1
                    
#: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=Netlenium&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Netlenium&version=1.0.1
                    
Install as a Cake Tool

Netlenium .NET Wrapper

This is a .NET Wrapper for Netlenium, this does not contain the executable files for Netlenium or any of the actual functionalities that Netlenium Provides.

You are required to install Netlenium on your preferred system and make sure it's running before using this library. If you are using a remote server that's hosting Netlenium, you don't need Netlenium to be installed on your machine. You can specify the remote address to connect to.


How to setup

This library does not require any special tools to build or use with your project. You can either build from source or use the already publicly available Nuget Package that's on Nuget.org

Using the package manager

Install-Package Netlenium

.NET CLI

dotnet add package Netlenium

Packet CLI

paket add Netlenium

If you lack the Netlenium installation on your system, you can head over to netlenium.intellivoid.info to download the correct binary/setup for your system. Note that if you want Netlenium to use Chrome, Firefox or any of the browsers that it supports, those browsers needs to be installed on your system too. Different variants are also supported, for example; Firefox Developer Edition.

Example Usage

You can construct a new session with the default driver.

var browser = new Intellivoid.Netlenium.Client();

// Send a request to Netlenium to start the session
browser.Start();

If you need to specify the remote endpoint if Netlenium is not running on your machine, it can simply be done like this

var browser = new Intellivoid.Netlenium.Client("http://localhost:8080");

// Send a request to Netlenium to start the session
browser.Start();

Or if you want to specify what type of driver you intend on using

var browser = new Intellivoid.Netlenium.Client(Intellivoid.Netlenium.DriverType.firefox);

// Send a request to Netlenium to start the session
browser.Start();

Netlenium can be configured to require authentication, you can provide your authentication like this

var browser = new Intellivoid.Netlenium.Client(
    targetDriver: Intellivoid.Netlenium.DriverType.auto,
    authenticationPassword: "Password123"
);

// Send a request to Netlenium to start the session
browser.Start();

Multiple arguments can be used including the ability to tell Netlenium to start the driver using a proxy, so the Web Browser would create connections through your proxy.

var browser = new Intellivoid.Netlenium.Client(
    targetDriver: Intellivoid.Netlenium.DriverType.auto,
    proxyConfiguration: new Intellivoid.Netlenium.Proxy
    {
        Enabled = true,
        Host = "127.0.0.1",
        Port = 8080,
        Scheme = Intellivoid.Netlenium.ProxyScheme.https,
        AuthenticationRequired  = true,
        Username = "anonymous" ,
        Password = "anonyomus"
    }
);

// Send a request to Netlenium to start the session
browser.Start();

This example below demonstrates how you can use Netlenium to automate a browser completely. This demo loads Google, types into the search box, submits the form and waits for the page to finish loading. Then goes through the search results and prints out the text of all the results.

Console.WriteLine("Navigating to Google");
browser.LoadUrl("https://google.com/");

Console.WriteLine("Typing into search box");
browser.GetElement(Intellivoid.Netlenium.By.Name, "q").SendKeys("Netlenium");

Console.WriteLine("Searching for results");
browser.GetElement(Intellivoid.Netlenium.By.Name, "q").Submit();

foreach(Intellivoid.Netlenium.Element element in browser.GetElements(Intellivoid.Netlenium.By.ClassName, "g"))
{
    // Go through each element and prints out the
    // "innerText" property.
    Console.WriteLine(element.InnerText);
    Console.WriteLine();
}

Console.WriteLine("Closing session");
browser.Stop();

Console.WriteLine("Done");
Console.ReadLine();
Product Compatible and additional computed target framework versions.
.NET Framework net452 is compatible.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 874 7/31/2019

Initial Release