Hey im pretty new to htmlAgilitypack so i can be doing something totaly wrong
the way the html is set up is
<table>
<tbody>
<tr>
<td class="column-level align-center">
<h4 class="subcategpry ">I want a number from here for each row</h4>
</td>
<td class="column-skill">
<div class="skill-details">
<h4 class="subcategory "> <a href="here is the sec thing i need">Here is the third thing i need</a>
</h4>
</div>
</td>
</tr>
</tbody>
</table>
but for some reason it wont
here is my code
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.LoadHtml(sb.ToString());
var query = from table in htmlDoc.DocumentNode.SelectNodes("//tbody").Cast<HtmlNode>()
from row in table.Elements("tr").Cast<HtmlNode>()
from cell in row.SelectNodes("td[@class='column-level align-center']").Cast<HtmlNode>()
from h4 in cell.SelectNodes("h4[@class='subcategory ']").Cast<HtmlNode>()
i have ben checkking sb.ToString() and it contains all the infomation i need to get so im sure it is not there
but with that code up there im only getting 2 records and i know i need around 20 give a take
i have this
select new { lvl = h4.InnerText}; in the end of var query
Kainore
0 Points
4 Posts
HtmlAgilityPack wont get more then 2 records
Apr 18, 2012 05:36 PM|LINK
Hey im pretty new to htmlAgilitypack so i can be doing something totaly wrong
the way the html is set up is
<table> <tbody> <tr> <td class="column-level align-center"> <h4 class="subcategpry ">I want a number from here for each row</h4> </td> <td class="column-skill"> <div class="skill-details"> <h4 class="subcategory "> <a href="here is the sec thing i need">Here is the third thing i need</a> </h4> </div> </td> </tr> </tbody> </table> but for some reason it wont here is my code HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument(); htmlDoc.LoadHtml(sb.ToString()); var query = from table in htmlDoc.DocumentNode.SelectNodes("//tbody").Cast<HtmlNode>() from row in table.Elements("tr").Cast<HtmlNode>() from cell in row.SelectNodes("td[@class='column-level align-center']").Cast<HtmlNode>() from h4 in cell.SelectNodes("h4[@class='subcategory ']").Cast<HtmlNode>()i have ben checkking sb.ToString() and it contains all the infomation i need to get so im sure it is not there
but with that code up there im only getting 2 records and i know i need around 20 give a take
i have this
select new { lvl = h4.InnerText}; in the end of var query