ArnabDeveloper.HtmlContent.Core 1.0.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package ArnabDeveloper.HtmlContent.Core --version 1.0.6                
NuGet\Install-Package ArnabDeveloper.HtmlContent.Core -Version 1.0.6                
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="ArnabDeveloper.HtmlContent.Core" Version="1.0.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ArnabDeveloper.HtmlContent.Core --version 1.0.6                
#r "nuget: ArnabDeveloper.HtmlContent.Core, 1.0.6"                
#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.
// Install ArnabDeveloper.HtmlContent.Core as a Cake Addin
#addin nuget:?package=ArnabDeveloper.HtmlContent.Core&version=1.0.6

// Install ArnabDeveloper.HtmlContent.Core as a Cake Tool
#tool nuget:?package=ArnabDeveloper.HtmlContent.Core&version=1.0.6                

HTML content

It takes a collection of HTTP URLs and returns HTML responses of them. Internally it used System.Net.WebClient to get the HTML response of the URLs.

There are five methods to get the HTML responses.

  • GetContent() get html contents synchronously
  • GetContentAsync() get html contents asynchronously
  • GetContentAsyncStream() get html contents asynchronously but start to return contents as they are ready before all are complete
  • GetContentParallelAsync() get html contents asynchronously in parallel
  • GetContentParallelForEachAsync() get html contents asynchronously in parallel using Parallel.ForEach()
  • GetContentParallelForEachProgressAsync() get html contents asynchronously in parallel using Parallel.ForEach() and start to return contents as they are ready before all are complete with progress data.

Example code to use the library:

IHtmlContentService _htmlContentService = new HtmlContentService();

_htmlContentService.Urls.Add("http://google.com");
_htmlContentService.Urls.Add("http://microsoft.com");

IEnumerable<WebSiteDataModel> webSiteDataModels = _htmlContentService.GetContent();

foreach (WebSiteDataModel webSiteDataModel in webSiteDataModels)
{
    Console.WriteLine(webSiteDataModel.WebsiteUrl);
    Console.WriteLine(webSiteDataModel.WebsiteData);
}

This is influenced by C# Advanced Async by TimCorey

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on ArnabDeveloper.HtmlContent.Core:

Package Downloads
Arc.HtmlContent.DI

Html Content Core DI for ASP.NET

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 728 4/2/2022
1.0.9 639 3/29/2022
1.0.8 428 11/28/2021
1.0.7 5,856 11/24/2021
1.0.6 468 11/23/2021
1.0.5 554 6/9/2021
1.0.4 499 6/9/2021
1.0.3 503 6/7/2021
1.0.2 524 6/6/2021
1.0.1 501 5/31/2021
1.0.0 417 5/30/2021

dotnet 6 upgrade