I'm having a big trouble trying to parse these html contents with HtmlAgilityPack
library.
In this piece of code, I would like to retrieve only the url (href) that reffers to uploaded.net, but I can't determine whether the url reffers to it.
<div class='downloads' id='download_block'>
<h5 style='text-align:center'>FREE DOWNLOAD LINKS</h5>
<h4>uploadable.ch</h4>
<ul class='parts'>
<li>
<a href="http://url/..." target="_blank"> text here</a>
</li>
</ul>
<h4>uploaded.net</h4>
<ul class='parts'>
<li>
<a href="http://url/..." target="_blank"> text here</a>
</li>
</ul>
<h4>novafile.com</h4>
<ul class='parts'>
<li>
<a href="http://url/..." target="_blank"> text here</a>
</li>
</ul>
</div>
This is how it looks on the webpage
And this is what I have:
nodes = myHrmlDoc.DocumentNode.SelectNodes(".//div[@class='downloads']/ul[@class='parts']")
I can't just use an array-index to determine the position like:
nodes(0) = uploadable.ch node
nodes(1) = uploaded.net node
nodes(2) = novafile.com node
...because they could change the amount of nodes and its hosting positions.
Note that also the urls will not contains the hosting names, are redirections like:
http://xxxxxx/r/YEHUgL44xONfQAnCNUVw_aYfY5JYAy0DT-i--
What could I do, in C# or else VB.Net?.