Posted on: 5/19/2014 11:33:47 PM | Views : 496

Hi,
I'm new to the HTML Agility Pack and am encountering an issue. I'm doing three "SelectSingleNode", and only the first one works. The strange thing is if I put a break point on the second "SelectSingleNode" and use the same code that worked for the first one, it fails. Here is my code :
Dim imageOne As HtmlNode = htmlDoc.DocumentNode.SelectSingleNode("//img[@src = '##IMAGEONE##']") imageOne.SetAttributeValue("src", res.First.ImageUrl) Dim a = htmlDoc.CreateElement("a") Dim offerIdOne As String = txtOfferId1.Text a.SetAttributeValue("href", "MYURL") a.ChildNodes.Add(imageOne) imageOne.ParentNode.ReplaceChild(a, imageOne) Dim imageTwo As HtmlNode = htmlDoc.DocumentNode.SelectSingleNode("//img[@src = '##IMAGETWO##']") imageTwo.SetAttributeValue("src", res.ElementAt(2).Imag ...

Go to the complete details ...