C# 웹 스크래퍼
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);
        }
    }
}
NuGet Download
PM > Install-Package IronWebScraper
C# 웹 스크래퍼

C# 웹 스크래퍼

IronWebScraper는 C# 코드를 사용하여 웹사이트에서 데이터와 파일을 추출하는 강력한 프레임워크를 제공합니다.

  1. NuGet 사용하여 프로젝트에 IronWebScraper를 설치합니다.
  2. WebScraper을(를) 확장하는 클래스를 생성합니다.
  3. 최소한 하나의 URL을 구문 분석하기 위해 Request 메서드를 사용하는 Init 메서드를 만드세요.
  4. 요청을 처리하기 위한 Parse 메서드를 생성하고, 확실히 Request 페이지를 더 만듭니다. response.Css을(를) 사용하여 jQuery 스타일의 CSS 선택자로 HTML 요소를 조작하세요.
  5. 응용 프로그램에서 웹 스크래핑 클래스의 인스턴스를 생성하고 Start(); 메서드를 호출합니다.
  6. 우리 C# 웹 스크래핑 튜토리얼을 읽고, IronWebScraper를 사용하여 고급 웹 크롤러를 만드는 방법을 배워보십시오.
C#을 사용하여 온라인 영화 웹사이트에서 데이터를 추출하는 방법을 알아보세요.
GitHub에서 보기

시작할 준비 되셨나요?

Nuget Downloads 149,116버전:2026.11방금 출시