在生产环境中测试,没有水印。
在您需要的地方使用。
使用功能齐全的产品30天。
几分钟内即可启动和运行。
在产品试用期间,全面访问我们的支持工程团队
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);
}
}
}Install-Package IronWebScraper
为在.NET 10, 9, 8, 7, 6, 5, Core, Standard, or Framework上运行的C#, F#, & VB.NET而设计
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 ClassInstall-Package IronWebScraper
IronWebScraper 提供了一个强大的框架来使用 C# 代码从网站中提取数据和文件。

只需编写一个C#网页抓取器类即可将成千上万甚至百万网页抓取为C#类实例、JSON或下载文件。IronWebScraper允许您编写简洁、线性的工作流程,模拟人类浏览行为。IronWebScraper将作为一群虚拟网络浏览器并行运行您的代码,既有礼貌又具容错性。
从文档开始
必须编程IronWebScraper以了解如何处理它遇到的每种类型的页面。这是通过使用CSS选择器或XPath表达式以非常简洁的方式实现的,并且可以在C#中完全自定义。这种自由让您可以决定在网站上抓取哪些页面,以及对抓取的数据进行什么操作。每种方法都可以在Visual Studio中干净地调试和观看。
跟随教程IronWebScraper处理多线程和网络请求,以便同时处理数百个并发线程,而无需开发人员去管理它们。礼貌可以设置为调节请求,从而减少对目标Web服务器的过度负载的风险。
与WebScraper一起启动和运行
IronWebScraper可以使用一个或多个“身份” - 模拟实际世界中人类请求的会话。每个请求可以通过编程方式或随机分配其自己的身份、用户代理、Cookie、登录甚至IP地址。请求通过URL、解析方法和POST变量的组合设置为自动唯一。
See API ReferenceIronWebScraper使用高级缓存技术,允许开发者在不联机的情况下“现场”更改代码并重放每一个先前的请求。每个抓取作业都会自动保存,并且在出现异常或停电时可以恢复。
WebScraper设置说明IronWebScraper通过Visual Studio安装程序迅速将网页抓取工具掌控在您的手中。无论是在Visual Studio中直接通过NuGet安装还是下载DLL,您都可以迅速完成设置。只需一个DLL,没有依赖项。
PM > Install-Package IronWebScraper 下载DLL





VB C# ASP.NET
了解Ahmed如何在他的项目中使用IronWebScraper将内容从一个站点迁移到另一个站点。提供用于抓取电子商务和博客网站的示例项目和代码
查看Ahmed的网页抓取教程 


Iron团队在.NET软件组件市场拥有超过10年的经验。







