Skip to content

Instantly share code, notes, and snippets.

@scottheckel
Created November 21, 2012 04:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottheckel/4122989 to your computer and use it in GitHub Desktop.
Save scottheckel/4122989 to your computer and use it in GitHub Desktop.
Parse HTML with CSS selectors using Fizzler and FizzlerEx
using Fizzler.Systems.HtmlAgilityPack;
using HtmlAgilityPack;
using System.Collections.Generic;
using System.Linq;
var web = new HtmlWeb();
var docNode = web.Load("http://dsc.discovery.com/tv-schedules/daily.html");
var shows =
from showRow in docNode.QuerySelectorAll("div.contentFrame tr")
select new
{
Name = showRow.QuerySelector("td:nth-child(3) strong").InnerText,
Time = showRow.QuerySelector("td:nth-child(1) div.cellPad").InnerText
};
@cnromaine
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment