1

I am trying to parse a simple data table from the following link:

http://www.tase.co.il/TASE/General/Company/companyHistoryData.htm?subDataType=0&companyID=001390&shareID=01100957

You will get the table, clicking the light green submit image on the lower left. The table id is: HistoryData1_gridHistoryData_DataGrid1 Trying to parse it using htmlagilitypack - using the following code:

HtmlNode dataTable = document.GetElementbyId("HistoryData1_gridHistoryData_DataGrid1");

HtmlNodeCollection dataTableRow = dataTable.SelectNodes("//tbody/tr");

I get a very dirty html, with 351 <TR> tags, but the content is not even close to the table content...

shriek
  • 5,157
  • 2
  • 36
  • 42
dror a
  • 21
  • 2

1 Answers1

0

Instead of

 datatable.SelectNodes("//tbody/tr");

use:

 datatable.SelectNodes("./tbody/tr");
jessehouwing
  • 106,458
  • 22
  • 256
  • 341