Created
November 21, 2012 04:19
-
-
Save scottheckel/4122989 to your computer and use it in GitHub Desktop.
Parse HTML with CSS selectors using Fizzler and FizzlerEx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blog here: http://www.scottheckel.com/tag/fizzlerex/
Codeplex: http://fizzlerex.codeplex.com/