Cross Platform Support

Designed for C#, F#, & VB.NET running on .NET 8, 7, 6, Core, Standard, or Framework

NET Logo
Visual Studio Logo Visual Studio Logo
NuGet Logo NuGet Logo
ReSharper
Windows Logo
Linux Logo
Mac Logo
Docker Logo Docker Logo
Azure Logo Azure Logo
AWS Logo AWS Logo

Get started: C# code examples

C# Web Scraper
using IronWebScraper;

public class Program
{
    private static void Main(string[] args)
    {
        var ScrapeJob = new BlogScraper();
        ScrapeJob.Start();
    }
}

public class BlogScraper : WebScraper
{
    public override void Init()
    {
        LoggingLevel = LogLevel.All;
        Request("https://www.zyte.com/blog/", Parse);
    }

    public override void Parse(Response response)
    {
        foreach (HtmlNode title_link in response.Css(".oxy-post-title"))
        {
            string strTitle = title_link.TextContentClean;
            Scrape(new ScrapedData() { { "Title", strTitle } });
        }

        if (response.CssExists("div.oxy-easy-posts-pages > a[href]"))
        {
            string next_page = response.Css("div.oxy-easy-posts-pages > a[href]")[0].Attributes["href"];
            Request(next_page, Parse);
        }
    }
}
Imports IronWebScraper

Public Class Program
	Public Shared Sub Main(ByVal args() As String)
		Dim ScrapeJob = New BlogScraper()
		ScrapeJob.Start()
	End Sub
End Class

Public Class BlogScraper
	Inherits WebScraper

	Public Overrides Sub Init()
		LoggingLevel = LogLevel.All
		Request("https://www.zyte.com/blog/", AddressOf Parse)
	End Sub

	Public Overrides Sub Parse(ByVal response As Response)
		For Each title_link As HtmlNode In response.Css(".oxy-post-title")
			Dim strTitle As String = title_link.TextContentClean
			Scrape(New ScrapedData() From {
				{ "Title", strTitle }
			})
		Next title_link

		If response.CssExists("div.oxy-easy-posts-pages > a[href]") Then
			Dim next_page As String = response.Css("div.oxy-easy-posts-pages > a[href]")(0).Attributes("href")
			Request(next_page, AddressOf Parse)
		End If
	End Sub
End Class

IronWebScraper provides a powerful framework to extract data and files from websites using C# code.

  1. Install IronWebScraper to your Project using NuGet
  2. Create a Class Extending WebScraper
  3. Create an Init method that uses the Request method to parse at least one URL.
  4. Create a Parse method to process the requests, and indeed Request more pages. Use response.Css to work with HTML elements using jQuery style CSS selectors
  5. In your application please create and instance of your web scraping class and call the Start(); method
  6. Read our C# webscraping tutorials to learn how to create advanced web crawlers using IronWebScraper

Human Support Directly From Our Development Team

Whether it's product, integration or licensing queries, the Iron product development team is on hand to support all of your questions. Get in touch and start a dialog with Iron to make the most of our library in your project.

Ask a Question

Powerful Scraping Engine Under Your Control

Just write a single C# web-scraper class to scrape thousands or even millions of web pages into C# Class Instances, JSON or Downloaded Files. IronWebScraper allows you to code concise, linear workflows simulating human browsing behavior. IronWebScraper will run your code as a swarm of virtual web browsers, massively paralleled, yet polite and fault tolerant.

Get Started with Documentation

Simple, Flexible Logic

IronWebScraper must be programmed to know how to handle each “type” of page it encounters. This is achieved in a very concise manner using CSS Selectors or XPath expressions and can be fully customized in C#. This freedom allows you to decide which pages to scrape within a website, and what to do with the data extracted. Each method can be debugged and watched neatly in Visual Studio.

Follow a Tutorial

Fast and Polite Behavior

IronWebScraper deals with multithreading and web-requests to allow for hundreds of concurrent threads without the developer needing to manage them. Politeness can be set to throttle requests, so reducing risk of excessive load on target web servers.

Up and Running with WebScraper

Create virtual user Identities

IronWebScraper can use one or multiple “identities” - sessions that simulate real world human requests. Each request may programmatically or randomly assign its own Identity, User Agent, Cookies, Logins and even IP addresses. Requests are set as auto-unique with a combination of URL, parse method and post variables.

See API Reference

Action Replay

IronWebScraper uses advanced caching to allow developers to change their code “on the fly” and replay every previous request without contacting the internet. Every scrape job is autosaved and can be resumed in the event of an exception or power outage.

WebScraper Setup Instructions
Visual Studio Library for PDF Creation and Content Editing.

Rapid Installation with Microsoft Visual Studio

IronWebScraper puts Web Scraping tools in your own hands quickly with a Visual Studio installer. Whether installing directly from NuGet within visual studio or downloading the DLL, you’ll be setup in no time. Just one DLL and no dependencies.

PM > Install-Package IronWebScraper Download DLL
Supports:
  • .NET Framework 4.0 and above support C#, VB, F#
  • Microsoft Visual Studio. .NET Development IDE Icon
  • NuGet Installer Support for Visual Studio
  • JetBrains ReSharper C# language assistant compatible
  • Microsoft Azure C# .NET  hosting platform compatible

.NET Webscraping Community Tutorials

Tutorial + Code Examples Webscraping in .NET | VB.NET & ASP.NET PDF

VB C# ASP.NET

Web Scraping in C# and VB.NET Projects

See how Ahmed uses IronWebScraper in his projects to migrate content from one site to another. Sample Projects and Code provided for scraping ecommerce and blog websites

Ahmed Aboelmagd .NET Software Engineer View Ahmed's WebScraping Tutorial
Our customers use IronWebScraper with...

Accounting and Finance Systems

  • # Receipts
  • # Reporting
  • # Invoice Printing
Add PDF Support to ASP.NET Accounting and Finance Systems

Business Digitization

  • # Documentation
  • # Ordering & Labelling
  • # Paper Replacement
C# Business Digitization Use Cases

Enterprise Content Management

  • # Content Production
  • # Document Management
  • # Content Distribution
.NET CMS PDF Support

Data and Reporting Applications

  • # Performance Tracking
  • # Trend Mapping
  • # Reports
C# PDF Reports
Join Them Today
Iron Software Enterprise .NET Component Developers

Thousands of corporations, governments, SMEs and developers alike trust Iron software products.

Iron's team have over 10 years experience in the .NET software component market.

Iron Software Customer Icon
Iron Software Customer Icon
Iron Software Customer Icon
Iron Software Customer Icon
Iron Software Customer Icon
Iron Software Customer Icon
Iron Software Customer Icon
Iron Software Customer Icon

World-Class Engineering,
24-Hour Support

Talk to an Expert

Ready to get started? Version: 2024.3 just released

Start for Free Total downloads: 78,421
View Licenses >