26 lines
799 B
C#
26 lines
799 B
C#
using AngleSharp;
|
|
using System.Threading.Tasks;
|
|
using System;
|
|
using System.Linq;
|
|
|
|
namespace AngleSharpTest
|
|
{
|
|
class Program
|
|
{
|
|
static async Task Main(string[] args)
|
|
{
|
|
var config = Configuration.Default.WithDefaultLoader();
|
|
var address = "https://en.wikipedia.org/wiki/List_of_The_Big_Bang_Theory_episodes";
|
|
var context = BrowsingContext.New(config);
|
|
var document = await context.OpenAsync(address);
|
|
var cellSelector = "tr.vevent td:nth-child(3)";
|
|
var cells = document.QuerySelectorAll(cellSelector);
|
|
var titles = cells.Select(m => m.TextContent);
|
|
foreach (var title in titles)
|
|
{
|
|
Console.WriteLine(title.ToString()); ;
|
|
}
|
|
}
|
|
}
|
|
}
|