using System.Collections;
using System.Collections.Generic;
using Hap = HtmlAgilityPack;
private const String UrlBiKurs = @"http://www.bi.go.id/id/moneter/informasi-kurs/transaksi-bi/Default.aspx";
private const String XpathTable = @"//table[@class=""table1""]";
public static void Main()
var doc = (new Hap.HtmlWeb()).Load(UrlBiKurs);
(from table in doc.DocumentNode.SelectNodes(XpathTable)
where table.Attributes.Contains(@"id")
from row in table.SelectNodes(@"tr")
where row.ChildNodes.Count >= 2 && row.ChildNodes.Any(p => p.Name.Equals(@"td"))
node.ChildNodes[1].ChildNodes[0].InnerText,
node.ChildNodes[3].ChildNodes[0].InnerText,
node.ChildNodes[4].ChildNodes[0].InnerText));
.Where(table => table.Attributes.Contains(@"id"))
.SelectMany(table => table.SelectNodes(@"tr"), (table, row) => new { table, row })
.Where(p => p.row.ChildNodes.Count >= 2 && p.row.ChildNodes.Any(pn => pn.Name.Equals(@"td")))
node.ChildNodes[1].ChildNodes[0].InnerText,
node.ChildNodes[3].ChildNodes[0].InnerText,
node.ChildNodes[4].ChildNodes[0].InnerText));