Reputation: 261
I'm trying to create a football Windows 8 Application in c#. In my hub page I would like to show the fixtures of the Barclays Premier League. Now I'm wondering if I can get the data from this website : http://espnfc.com/fixtures/_/league/eng.1/english-premier-league?cc=5739
Is this possible with the Html Agility pack? Or does anyone know some great RSS feeds? Feel free to share your thoughts about other options!
Thanks in advance!
Upvotes: 0
Views: 857
Reputation: 707
Please keep in mind you would a WinRT compiled version of the HTML Agility Pack for it to work as a Windows Store application library.
Parsing web-pages for that kind of data is definitely possible, I found it easy using Xpath. There's a lot of extensions for browsers that will help you construct queries, for example iXpath Helper for Chrome.
Here's a sample of the code I developed to get dates of matches: need to construct to get dates of matches from a fixtures website:
var url = "http://www.livefootball.com/football/england/premier-league/results/all/";
var webGet = new HtmlAgilityPack.HtmlWeb();
var document = webGet.Load(url);
var dates = document.DocumentNode.SelectNodes("//dl[@class='mElHeaderDet']");
foreach (var node in dates)
{
listOfDates.Add(node.InnerText);
}
Upvotes: 1