using System.Collections.Generic;
using Fizzler.Systems.HtmlAgilityPack;
public string Title { get; init; }
public string? ImageUrl { get; init; }
public int Year { get; init; }
public string Description { get; init; }
public bool IsPremium { get; init; }
static void Main(string[] args)
<h1 class='title'>Titanic</h1>
<img src='https://m.media-amazon.com/images/M/MV5BMDdmZGU3NDQtY2E5My00ZTliLWIzOTUtMTY4ZGI1YjdiNjk3XkEyXkFqcGdeQXVyNTA4NzY1MzY._V1_FMjpg_UX1000_.jpg' />
<p class='release-year'>1997</p>
<p class='description'>Titanic: Directed by James Cameron. With Leonardo DiCaprio, Kate Winslet, Billy Zane, Kathy Bates. A seventeen-year-old aristocrat falls in love with a kind but poor artist aboard the luxurious, ill-fated R.M.S. Titanic.</p>
<h1 class='title'>A Boy Called Christmas</h1>
<p class='release-year'>2021</p>
<p class='description'>An ordinary young boy called Nikolas sets out on an adventure into the snowy north in search of his father who is on a quest to discover the fabled village of the elves, Elfhelm. Taking with him a headstrong reindeer called Blitzen and a loyal pet mouse, Nikolas soon meets his destiny.</p>
<h1 class='title'>Good on Paper</h1>
<img src='https://m.media-amazon.com/images/M/MV5BMDdmZGU3NDQtY2E5My00ZTliLWIzOTUtMTY4ZGI1YjdiNjk3XkEyXkFqcGdeQXVyNTA4NzY1MzY._V1_FMjpg_UX1000_.jpg' />
<p class='release-year'>2021</p>
<p class='description'>After years of putting her career ahead of love, stand-up comic Andrea Singer stumbles upon the perfect guy. On paper, Dennis checks all the boxes, but Andrea's friend, Margot, is convinced he's not all he appears to be.</p>
<h1 class='name'>Jupiter's Legacy</h1>
<img src='https://m.media-amazon.com/images/M/MV5BMDdmZGU3NDQtY2E5My00ZTliLWIzOTUtMTY4ZGI1YjdiNjk3XkEyXkFqcGdeQXVyNTA4NzY1MzY._V1_FMjpg_UX1000_.jpg' />
<p class='release-year'>2021</p>
<p class='description'>The super-powered children of superheroes struggle to live up to the legendary feats of their parents.</p>
<p class='premium'>Subscription required</p>
HtmlDocument htmlDoc = new HtmlDocument();
IEnumerable<HtmlNode> movieNodes = htmlDoc.DocumentNode
.QuerySelector("div#content")
.QuerySelectorAll("div.movie");
IReadOnlyList<Movie> movies = movieNodes
.Select((HtmlNode div, int index) =>
Console.WriteLine($"Parsing movie ({index + 1}/{movieNodes.Count()})");
string title = div.QuerySelector("h1.title").InnerText;
string? imageUrl = div.QuerySelector("img")?.Attributes["src"].Value;
string description = div.QuerySelector("p.description").InnerText;
bool isPremium = div.QuerySelector("p.premium") != null;
int releaseYear = Int32.Parse(div.QuerySelector("p.release-year").InnerText);
Console.WriteLine($"Parsed data for movie: {title}");
Description = description,
.Where(movie => !movie.IsPremium && movie.Year == 2021)
foreach (var movie in movies)
Title: " + movie.Title + @"
Image URL: " + movie.ImageUrl + @"
Description: " + movie.Description + @"
IsPremium: " + movie.IsPremium + @"
Year: " + movie.Year + @"