Hello im trying to get this "a" atrribute from this HTML source code using HtmlAgilityPack in C#.
<table width='200'>
<tr>
<td width='50'>
<a href='index.php?action=shop&type=koszulka'>
<img src='images/lay_game/miasto/sklep.png' width='40' class="dymek" style='cursor:pointer;' title="Tutaj możesz kupić wyposażenie dla swojego zawodnika" /></a>
</td>
<td>
<a href='index.php?action=shop&type=koszulka' >Sklepy</a>
</td>
</tr>
<tr>
<td width='50'>
<a href='index.php?action=37317|lbr5tlbphafc3cf30b08vl8601|trening|MCMxIzI=|a32a443dd66c39e8cce9a4903171d81b|162f3a6d72c860855a5dc3de18c8855c'>
<img src='images/lay_game/miasto/trening.png' width='40' class="dymek" style='cursor:pointer;' title="Chcesz podnieść swoje umiejętności? Dobrze trafiłeś"/></a>
</td>
<td>
<a href='index.php?action=37317|lbr5tlbphafc3cf30b08vl8601|trening|MCMxIzI=|a32a443dd66c39e8cce9a4903171d81b|162f3a6d72c860855a5dc3de18c8855c'>Trening</a>
</td>
</tr>
<tr>
<td width='50'>
<a href='index.php?action=hospital'>
<img src='images/lay_game/miasto/szpital.png' width='40' class="dymek" style='cursor:pointer;' title="Możesz tu zredukować zmęczenie, wyleczyć kontuzję lub podnieść formę"/></a>
</td>
<td>
<a href='index.php?action=hospital'>Szpital</a>
</td>
</tr>
<tr>
<td width='50'>
<a href='index.php?action=gielda'>
<img src='images/lay_game/miasto/centrum.png' width='40' class="dymek" style='cursor:pointer;' title="Chcesz zarobić i nie boisz się ryzyka? Zatem witamy na giełdzie FT" /></a>
</td>
<td>
<a href='index.php?action=gielda'>Giełda</a>
</td>
</tr>
<tr>
<td width='50'>
<a href='index.php?action=pojedynek'>
<img src='images/lay_game/miasto/pojedynek.png' width='40' class="dymek" style='cursor:pointer;' title="Pojedynek Uliczny." /></a>
</td>
<td>
<a href='index.php?action=pojedynek'>Pojedynek</a>
</td>
</tr>
</table>
My target is a attribute with href="index.php?action=37317|lbr5tlbphafc3cf30b08vl8601|trening|MCMxIzI=|a32a443dd66c39e8cce9a4903171d81b|162f3a6d72c860855a5dc3de18c8855c"
I really dunno how to get this. My trying code is below:
HtmlAgilityPack.HtmlDocument HTMLParser = new HtmlAgilityPack.HtmlDocument();
HTMLParser.LoadHtml(result);
string href;
foreach (HtmlNode node in HTMLParser.DocumentNode.SelectNodes("//table//tr//td//a"))
{
href = node.ChildNodes[0].InnerHtml;
}
But it not working :(