vb.net htmlagilitypack loop of selectnode
<p>i made an array of links </p>

<pre><code>Dim horof As String = "A B C D"
    Dim alphabarray As String() = horof.Split(New Char() {" "c})
    Dim urls() As String = alphabarray.Select(Function(o) "http://somelink/list-" &amp; o).ToArray()
</code></pre>

<p>the output is like this </p>

<pre><code>http://somelink/list-A
http://somelink/list-B
http://somelink/list-C
http://somelink/list-D
</code></pre>

<p>thin i made <code>webrequest</code> for each link like this :</p>

<pre><code> For i As Int32 = 0 To urls.Length - 1
        Dim wRequest As WebRequest
        Dim WResponse As WebResponse
        wRequest = FtpWebRequest.Create(urls(i))
        WResponse = wRequest.GetResponse
        Dim SR As StreamReader
        SR = New StreamReader(WResponse.GetResponseStream)
        urls(i) = SR.ReadToEnd
 Next
</code></pre>

<p>now i have html source of all the links in array of string that is <code>urls</code>
and i want to use htmlagilitypack to <code>selectnodes</code>from each html source in the array</p>

<pre><code>Dim htmlDoc As New HtmlDocument()
htmlDoc.LoadHtml(urls) 
Dim wantednode = htmlDoc.DocumentNode.SelectNodes("Xpath")
</code></pre>

<p>but it didnt work </p>

<p>i try to pu it in the same loop </p>

<pre><code>        Dim htmlDoc As New HtmlDocument()
        Dim wantednode As HtmlNodeCollection
For i As Int32 = 0 To urls.Length - 1
        Dim wRequest As WebRequest
        Dim WResponse As WebResponse
        wRequest = FtpWebRequest.Create(urls(i))
        WResponse = wRequest.GetResponse
        Dim SR As StreamReader
        SR = New StreamReader(WResponse.GetResponseStream)
        urls(i) = SR.ReadToEnd
        htmlDoc.Load(urls(i))
        wantednode = htmlDoc.DocumentNode.SelectNodes("Xpath")
next
</code></pre>

<p>this didnt work too
how to make loop of <code>wantednode = htmlDoc.DocumentNode.SelectNodes("Xpath")</code>
for each htmlcode in the <code>urls</code> array </p>

<p>each html code in <code>urls</code> array are like this that came from </p>

<pre><code>        &lt;body&gt;
          &lt;div class="list_body"&gt;

            &lt;ul class="listing"&gt;

                &lt;li&gt;
                    &lt;a href="http://wanted1.com" title=""&gt;title1 &lt;/a&gt;                                               
                     &lt;/li&gt;
                &lt;li&gt;
                    &lt;a href="http://wanted2.com" title=""&gt;title2  &lt;/a&gt;                             
                     &lt;/li&gt;
                &lt;li&gt;
                    &lt;a href="http://wanted3.com" title=""&gt;title3  &lt;/a&gt;                                                
                     &lt;/li&gt;
                &lt;li&gt;
                    &lt;a href="http://wanted4.com" title=""&gt;title4   &lt;/a&gt;                                                                       
                     &lt;/li&gt;
                &lt;li&gt;
                    &lt;a href="http://wanted5.com" title=""&gt;title5  &lt;/a&gt;                                                                                               
                     &lt;/li&gt;
                &lt;li&gt;
                    &lt;a href="http://wanted6.com" title=""&gt;title6   &lt;/a&gt;                                                                                                
                     &lt;/li&gt;
            &lt;/ul&gt;

          &lt;/div&gt;
       &lt;/body&gt;
</code></pre>

<p>i want <code>http://wanted2.com</code> link in every string in <code>urls</code></p>