Get row from AngleSharp.Dom.Html.HtmlSpanElement
-
Hello everyone. I'm currently trying to get into htmls and as a start wanted to create a program which reads the current Artist and song out of a Webradio. So far i can read out an Artist and song but it's not the current one but the last one in the list on the site...could anyone help me getting the current one? That'd be great. :) Here is my Code so far:
using (WebClient client = new WebClient())
{string htmlCode = client.DownloadString("http://www.planetradio.de/music/trackfinder.html"); var parser = new HtmlParser(); var document = parser.Parse(htmlCode); var hitfinderTable = document.All.Where(m => m.Id == "hitfindertable").First() as AngleSharp.Dom.Html.IHtmlTableElement; foreach (var row in hitfinderTable.Rows) { var artistName = row.Cells\[2\].TextContent; var songName = row.Cells\[3\].TextContent; label.Content = artistName + " " + songName; } }
Thanks to everyone in advance.
-
Hello everyone. I'm currently trying to get into htmls and as a start wanted to create a program which reads the current Artist and song out of a Webradio. So far i can read out an Artist and song but it's not the current one but the last one in the list on the site...could anyone help me getting the current one? That'd be great. :) Here is my Code so far:
using (WebClient client = new WebClient())
{string htmlCode = client.DownloadString("http://www.planetradio.de/music/trackfinder.html"); var parser = new HtmlParser(); var document = parser.Parse(htmlCode); var hitfinderTable = document.All.Where(m => m.Id == "hitfindertable").First() as AngleSharp.Dom.Html.IHtmlTableElement; foreach (var row in hitfinderTable.Rows) { var artistName = row.Cells\[2\].TextContent; var songName = row.Cells\[3\].TextContent; label.Content = artistName + " " + songName; } }
Thanks to everyone in advance.