WebImageExtractor 1.0.1

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

Blazor Demo

Available on NuGet

Install using the NuGet Package Manager:

Install-Package WebImageExtractor -Version 1.0.0

Features (all are optional and can be speicified in ExtractionSettings):

  • Extracts Favicons and Apple touch icons.
  • Extracts images from <img> tags.
  • Extracts images from <link> and <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 .css files.
  • Supports Uri Recursion. E.g. Extracting from https://example.com/dir/page.html also extracts from https://example.com/dir and https://example.com.
  • 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.

To see an online example use of this tool, checkout this Blazor demo. You can find the source code for the demo here.

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 <link> and <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.

Documentation

See the GitHub Readme for a complete and updated quick-start.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos 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 (1)

Showing the top 1 popular GitHub repositories that depend on WebImageExtractor:

Repository Stars
James231/Start-Menu-Manager
App to add websites/software/files/folders/scripts to the Windows 10 Start Menu and Taskbar, and priority shortcuts to Windows 10 Search.
Version Downloads Last updated
1.0.2 756 8/28/2020
1.0.1 384 8/27/2020
1.0.0 383 8/27/2020