![]() |
VOOZH | about |
dotnet add package AngleSharp.Io --version 1.0.0
NuGet\Install-Package AngleSharp.Io -Version 1.0.0
<PackageReference Include="AngleSharp.Io" Version="1.0.0" />
<PackageVersion Include="AngleSharp.Io" Version="1.0.0" />Directory.Packages.props
<PackageReference Include="AngleSharp.Io" />Project file
paket add AngleSharp.Io --version 1.0.0
#r "nuget: AngleSharp.Io, 1.0.0"
#:package AngleSharp.Io@1.0.0
#addin nuget:?package=AngleSharp.Io&version=1.0.0Install as a Cake Addin
#tool nuget:?package=AngleSharp.Io&version=1.0.0Install as a Cake Tool
👁 CI
👁 GitHub Tag
👁 NuGet Count
👁 Issues Open
👁 Gitter Chat
👁 StackOverflow Questions
AngleSharp.Io extends AngleSharp with powerful requesters, caching mechanisms, and storage systems. It is coupled more strongly to the underlying operating system than AngleSharp itself. Therefore it has stronger dependencies and demands and cannot be released for the standard framework (4.6). Nevertheless, it is released as a .NET Standard 2.0 library.
If you just want to use all available requesters provided by AngleSharp.Io you can do the following:
var config = Configuration.Default
.WithRequesters() // from AngleSharp.Io
.WithDefaultLoader(); // from AngleSharp
This will register all requesters. Alternatively, the requesters can be provided explicitly. They are located in the AngleSharp.Io.Network namespace and have names such as DataRequester.
Requesters can make use of HttpClientHandler instances. Hence using it, e.g., with a proxy is as simple as the following snippet:
var handler = new HttpClientHandler
{
Proxy = new WebProxy(myProxyHost, false),
PreAuthenticate = true,
UseDefaultCredentials = false,
};
var config = Configuration.Default
.WithRequesters(handler) // from AngleSharp.Io with a handler config
.WithDefaultLoader();
Alternatively, if you don't want to add all possible requesters, you can also just add a single requester from AngleSharp.Io:
var config = Configuration.Default
.With(new HttpClientRequester()) // only requester
.WithDefaultLoader();
In the code above we now only have a single requester - the HttpClientRequester coming from AngleSharp.Io. If we have an HttpClient already used somewhere we can actually re-use it:
var config = Configuration.Default
.With(new HttpClientRequester(myHttpClient)) // re-using the HttpClient instance
.WithDefaultLoader();
To get improved cookie support, e.g., do
var config = Configuration.Default
.WithTemporaryCookies(); // Uses memory cookies
or if you want to have persistent cookies you can use:
var syncPath = $"Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)\\anglesharp.cookies";
var config = Configuration.Default
.WithPersistentCookies(syncPath); // Uses sync cookies against the given path
Alternatively, the new overloads for the WithCookies extension method can be used.
AngleSharp.Io offers you the possibility of a simplified downloading experience. Just use WithStandardDownload to redirect resources to a callback.
In the simplest case you can write:
var config = Configuration.Default
.WithStandardDownload((fileName, content) =>
{
// store fileName with the content stream ...
});
Alternatively, use WithDownload, which allows you to distinguish also on the provided MIME type.
The IHtmlInputElement interface now has AppendFile to easily allow appending files without much trouble.
document
.QuerySelector<IHtmlInputElement>("input[type=file]")
.AppendFile("c:\\example.jpg");
More overloads exist.
Furthermore, the IUrlUtilities interface now has DownloadAsync.
document
.QuerySelector<IHtmlAnchorElement>("a#download-document")
.DownloadAsync()
.SaveToAsync("c:\\example.pdf");
The SaveToAsync (as well as the CopyToAsync) are extension methods for the IResponse interface.
HttpClient)IStorage interfaceAdvancedCookieContainer)Participation in the project is highly welcome. For this project the same rules as for the AngleSharp core project may be applied.
If you have any question, concern, or spot an issue then please report it before opening a pull request. An initial discussion is appreciated regardless of the nature of the problem.
Live discussions can take place in our Gitter chat, which supports using GitHub accounts.
This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.
For more information see the .NET Foundation Code of Conduct.
This project is supported by the .NET Foundation.
The MIT License (MIT)
Copyright (c) 2015 - 2023 AngleSharp
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 is compatible. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 is compatible. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 was computed. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 is compatible. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 is compatible. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on AngleSharp.Io:
| Package | Downloads |
|---|---|
|
ChromeHtmlToPdf
ChromiumHtmlToPdf is a 100% managed C# library that can be used to convert HTML to PDF or PNG format with the use of Google Chrome or Microsoft Edge |
|
|
Elect.Core
Comprehensive collection of essential utilities and extension methods for .NET Core applications. Includes helpers for configuration, dependency injection, serialization, HTTP operations, and common programming patterns. |
|
|
Carbon.Kit
Provides interfaces, abstractions and common functions which is the essence of Carbon Kit. |
|
|
Invedia.Core
.Net Core Utilities methods |
|
|
PickAll
.NET agile and extensible web searching API |
Showing the top 5 popular GitHub repositories that depend on AngleSharp.Io:
| Repository | Stars |
|---|---|
|
CodeMazeBlog/CodeMazeGuides
The main repository for all the Code Maze guides
|
|
|
Sicos1977/ChromiumHtmlToPdf
Convert HTML to PDF with a Chromium based browser
|
|
|
MRCollective/ChameleonForms
Shape-shifting your forms experience in ASP.NET Core MVC
|
|
|
topnguyen/Elect
The collection of utilities, best practice and fluent method for .NET Core
|
|
|
AngleSharp/AngleSharp.Js
:angel: Extends AngleSharp with a .NET-based JavaScript engine.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 269,595 | 1/15/2023 |
| 1.0.0-beta.22 | 241 | 2/25/2024 |
| 1.0.0-alpha-20 | 726 | 1/15/2023 |
| 1.0.0-alpha-18 | 667 | 1/15/2023 |
| 0.17.0 | 433,736 | 5/31/2022 |
| 0.17.0-alpha-14 | 690 | 5/31/2022 |
| 0.16.0 | 81,228 | 6/12/2021 |
| 0.16.0-alpha-8 | 988 | 6/12/2021 |
| 0.16.0-alpha-6 | 915 | 6/12/2021 |
| 0.15.0 | 70,269 | 4/23/2021 |
| 0.15.0-alpha-3 | 845 | 4/23/2021 |
| 0.14.0 | 467,464 | 3/31/2020 |
| 0.14.0-alpha-99 | 1,230 | 3/31/2020 |
| 0.14.0-alpha-98 | 1,327 | 1/6/2020 |
| 0.13.1 | 49,913 | 9/24/2019 |
| 0.13.1-alpha-92 | 1,127 | 9/24/2019 |
| 0.13.0 | 39,413 | 9/7/2019 |
| 0.13.0-alpha-89 | 1,123 | 9/7/2019 |
| 0.13.0-alpha-83 | 1,128 | 8/23/2019 |
| 0.13.0-alpha-81 | 1,246 | 5/18/2019 |