===スクレイピング===
[http://anglesharp.github.io/ AngleSharp]
<pre>
using AngleSharp.Html.Parser;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
namespace Hoge
{
public class Crawler
{
private static HttpClient _client = new HttpClient();
public async void Fetch(string url)
{
using(var stream = await _client.GetStreamAsync(url))
{
var parser = new HtmlParser();
var doc = parser.ParseDocument(stream);
var ankers = doc.All.Where(m => m.LocalName == "a");
foreach(var anker in ankers)
{
Debug.WriteLine(anker.TextContent);
}
}
}
}
}
</pre>
===文字列配列を結合してCSVを作成===
<pre>