dags att checka in
This commit is contained in:
25
AngleSharpTest/Program.cs
Normal file
25
AngleSharpTest/Program.cs
Normal file
@ -0,0 +1,25 @@
|
||||
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()); ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user