Im using HtmlAgilityPack and Xpath to retrieve some text from a webpage. My problem is that the it retrieves all the whitespaces aswell. I need some help using the "fn:normalize-space(string)" function to normalize the retrieved text.
Code:Dim content2 As String = "" Dim web2 As New HtmlAgilityPack.HtmlWeb Dim doc2 As HtmlAgilityPack.HtmlDocument = web2.Load("http://www.yellowpages.ca/search/si/1/Estheticians/Calgary+AB ") Dim hnc2 As HtmlAgilityPack.HtmlNodeCollection = doc2.DocumentNode.SelectNodes("//div[@class='address']") For Each link As HtmlAgilityPack.HtmlNode In hnc2 Dim replaceUnwanted As String = "" replaceUnwanted = link.InnerText.Replace("&", "&") ' replaceUnwanted = replaceUnwanted.Replace("'", "'") content2 &= replaceUnwanted & vbNewLine Next RichTextBox2.Text = content2




Reply With Quote