I want to parse date, link text and link href from table class='nice' on web page http://cslh.cz/delegace.html?id_season=2013
I have created object DelegationLink
public class DelegationLink
{
public string date { get; set; }
public string link { get; set; }
public string anchor { get; set; }
}
and used it with LINQ to create List of DelegationLink
var parsedValues =
from table in htmlDoc.DocumentNode.SelectNodes("//table[@class='nice']")
from date in table.SelectNodes("tr//td")
from link in table.SelectNodes("tr//td//a")
.Where(x => x.Attributes.Contains("href"))
select new DelegationLink
{
date = date.InnerText,
link = link.Attributes["href"].Value,
anchortext = link.InnerText,
};
return parsedValues.ToList();
which takes date column ony by one and combine it with link column in every row, but i just want to simply take every row in table and get date, href and hreftext from that row. I am new to LINQ and i used google for a 4 hours without any effect. Thanks for the help.