See the version list below for details.
Install-Package WebImageExtractor -Version 1.0.1
dotnet add package WebImageExtractor --version 1.0.1
<PackageReference Include="WebImageExtractor" Version="1.0.1" />
paket add WebImageExtractor --version 1.0.1
#r "nuget: WebImageExtractor, 1.0.1"
// Install WebImageExtractor as a Cake Addin #addin nuget:?package=WebImageExtractor&version=1.0.1 // Install WebImageExtractor as a Cake Tool #tool nuget:?package=WebImageExtractor&version=1.0.1
Web Image Extractor
.NET library to extract images and icons from websites. Provides options to select Favicons, Apple Touch Icons, or all images on a page.
Install using the NuGet Package Manager:
Install-Package WebImageExtractor -Version 1.0.0
Features (all are optional and can be speicified in
- Extracts Favicons and Apple touch icons.
- Extracts images from
- Extracts images from
<meta>tags within HTML head.
- Extracts images from background images in CSS
background-image: uri('https://...'). Currently this only works for inline styles and not referenced
- Supports Uri Recursion. E.g. Extracting from
https://example.com/dir/page.htmlalso extracts from
- Supports following Hyperlinks (specified in
<a>tags) up to a certain depth and extracting images from those pages too.
- Supports triggering events when new images are found or new pages are explored.
- Supports ending the extraction algorithm when a condition is met (e.g. enough images found).
- Supports Blazor (including Client Side Blazor / Blazor WebAssembly).
- Includes example console application.
Note: If you are after something specific, e.g. a way of getting 48px square
.ico icons from websites ... please note that some websites might only have one icon available and others might not have any. This library isn't magic, so you might not get exactly what you want. It's always best to give a user choice over the best icon/image, or even let them provide their own, don't rely entirely on the algorithms.
How does it work?
Favicons are found from the standard places. First the path
/favicon.ico is checked, and then it checks for
<link> tags in the HTML head. Any link with a valid Favicon
rel property will be returned as a Favicon.
It works in a similar way for Apple Touch Icons.
When looking for all images on a page, Favicons and Apple touch icons are retrieved, then all other images in
<meta> tags are retrieved, followed by all images in
<img> tags, and finally all images specified using
background-image: url('https://...') within inline styles (if enabled in settings). Note that images are not pulled from
background-image styles set in separate
.css files. It only works for inline styles.
Recursion works by exploring Uris with segments removed, and by following hyperlinks (
<a> tags) on the page, providing these are enabled in the settings.
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.