编写代码作为从网页抓取链接的网络爬虫的开始。
按照此页面的说明进行操作:
http://www.dotnetperls.com/scraping-html
我似乎收到无法找到 LinkFinder 的错误?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Diagnostics;
namespace WebCrawler
{
class Program
{
static void Main(string[] args)
{
WebClient url = new WebClient();
String initialLink = url.DownloadString("http://www.FAKEADDRESS.org.uk/");
for (LinkItem i in LinkFinder.find(initialLink))
{
System.Diagnostics.Debug.WriteLine(initialLink);
}
}
}
}